nhaarman
10/13/2016, 8:57 PMfun thisShouldPrintHi() = async<Unit> {
try {
val reason = await(async<String> {
throw IOException()
})
TODO(reason)
} catch(e: IOException) {
println("Hi")
}
}
fun thisShouldCrashWithANotImplementedError() = async<Unit> {
try {
val reason = await(async<String> {
"Hello"
})
TODO(reason)
} catch(e: IOException) {
println("Hi")
}
}
And ideally without appending an extra method call like exceptionally { }
to it, because I tend to forget those.
I guess such a call would be placed inside the async
method, but when applied like above, every error thrown makes the app crash, even the IOException
in the thisShouldPrintHi()
function.