Is there a way to use the `use` keyword and also c...
# announcements
p
Is there a way to use the
use
keyword and also catch exceptions? Seems like the exception doesn't reach the caller of
doSomething
Copy code
override fun doSomething() {
        sessionCreator.createSession().use(fun(session: SqlSession) {
            // Some code
            throw Exception("Test Exception")
        })
    }
s
Doesnt seem right.
use()
rethrows the exception
p
I think you're right
It's getting lost somewhere else
r
Also, a bit pedantic, but
use
is just a function, not a keyword.
👍 1