First, thanks for the post, it really helps me a lot.

I have a question here. I tried the first example with the following code and it seems that the app won’t crash. Is there anything I misunderstand?

val job: Job = Job()
val scope = CoroutineScope(Dispatchers.Default + job)
fun doWork(): Deferred<String> = scope.async { throwException() }
fun loadData() = scope.launch {
try {
doWork().await()
} catch (e: Exception) {}
Log.d("demo", "The app won't crash and this line can be
executed")
}
loadData()

An Android/Flutter engineer at Line Corporation.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store