wcaokaze
11/05/2018, 11:59 AMlaunch {
try {
async { throw IOException() }.await()
} catch (e: IOException) {
}
}
I get an uncaught IOException. What is wrong?async {
try {
async { throw IOException() }.await()
} catch (e: IOException) {
}
}
I get no Exception.Jonathan
11/05/2018, 12:21 PMasync
is a child of launch
making it fail imediately.async
it is the same, but exception is not logged, because you're supposed to call await
async
only for parallel decomposition. For other uses-cases just use suspending functions (without using async
at all)wcaokaze
11/05/2018, 12:41 PM