https://kotlinlang.org logo
#coroutines
Title
# coroutines
t

thana

09/02/2019, 2:22 PM
i have a
fun
that creates a
CoroutineExceptionHandler
. when i do
launch(exceptionHandler()){throw RuntimeException()}
it gets called but with
runBlocking
the exception is not caught. is that expected behavior?
d

Dominaezzz

09/02/2019, 2:41 PM
Yes because
runBlocking
has to return a value.
t

thana

09/02/2019, 2:46 PM
yeah makes sense... but i think the documentation should make that clear, shouldn't it?
d

Dominaezzz

09/02/2019, 2:57 PM
Like explicitly? I think it does it the documentation of
CoroutineExceptionHandler
.
t

thana

09/02/2019, 3:08 PM
Yes you are right - i was just looking through the docs of
runBlocking
. Thank you!
4 Views