mbonnin
06/11/2019, 12:38 PMGlobalScope.launch {
val deferred = CompletableDeferred<Unit>()
Thread {
val result = doSomething()
if (result == SUCCESS) {
deferred.complete(Unit)
} else {
deferred.completeExceptionally(Exception("oopps"))
}
}.start()
deferred.await()
}
This is working well in the nominal case but in the error case, nothing in the backstack indicates where the await() is done. Is there any chance I could have that info somehow to help debug a crash ?await
are basically scattered in all the codebase and the thread is the okhttp threadpool. I get a crash from firebase reporting but no clue where the missing try/catch is.gildor
06/11/2019, 1:41 PMmbonnin
06/11/2019, 1:43 PM