How to recover the coroutine's true call trace?

后端 未结 3 2070
醉梦人生
醉梦人生 2021-02-06 06:20

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

相关标签:
3条回答
  • 2021-02-06 06:27

    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.

    0 讨论(0)
  • 2021-02-06 06:30

    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).

    0 讨论(0)
  • 2021-02-06 06:39

    Kotlin plugin for IntelliJ IDEA provides this possibility since version 1.4 (for versions 1.3.8 or later of kotlinx-coroutines-core).

    0 讨论(0)
提交回复
热议问题