:question: What is supposed to happen if `async {}...
# coroutines
v
What is supposed to happen if
async {}
block throws an exception, but the result is never used? I get different behaviour in playground and InteliJ https://pl.kotl.in/rkOAdiNiQ
Copy code
suspend fun main() {
    coroutineScope {
        val x = async { null!! }
    }
    
    println("end")
}
g
What is result that you expect. Behavior of playground the same as should be for async according to docs
Await encapsulate exception and do not throwing it until someone calls await
v
@gildor I use coroutines_version = '0.30.2-eap13' and this example propagates the exception up into my bash
d
I believe this behaviour changed recently to be the same as launch, because otherwise it's painful to await multiple async calls correctly while still stopping if an error occurs anywhere
v
@Daniel Tam do you know where could I read about it?
v
👍🏼
g
Ahhh, sure, coroutineScope will throw an error anyway, because failed async will cancel coroutineScope
v
BTW, how do I revert to the old behaviour? I don't care about the error until I need the result
g