- kotlin version 1.3.40
- coroutines version 1.2.1
- android build tool version 3.3.2
- reported here: Kotlin/kotlinx.coroutines#1288
suspend function retrieve
in line 50-55 throws an exception
suspend function call
in line 37-48 calls the previous function via async{ retrieve() }....await()
and should catch the exception
Without proguard minification (minifyEnabled false
) the exception is handled properly:
D/Main: waited for 100ms, throwing IOException
E/Main: caught could not contact server
D/Main: success: false
With proguard minification (minifyEnabled true
) the exceptions just disappear and the outcome of the program changes to:
D/Main: waited for 100ms, throwing IOException
D/Main: waited for 100ms, throwing IOException
D/Main: all successful retrieved
D/Main: success: true
Just change the minifyEnabled property here and the behavior should change: