This is a painfully familiar problem to anyone working with async APIs: when your call encounters a failure, the async library\'s private thread detects it, creates an exception
Just found a github issue related to this:
Stacktrace recovery ( https://github.com/Kotlin/kotlinx.coroutines/pull/792 ) and the related doc ( https://github.com/Kotlin/kotlinx.coroutines/blob/master/docs/debugging.md )
Without the caller site stacktrace, coroutine debugging is indeed painful. Hope that the "debug mode" can help. Will try and see.
First off all the feature is broken at the moment. If the bug is fixed I would try System.setProperty(DEBUG_PROPERTY_NAME,DEBUG_PROPERTY_VALUE_ON)
.
Kotlin plugin for IntelliJ IDEA provides this possibility since version 1.4 (for versions 1.3.8 or later of kotlinx-coroutines-core
).