https://kotlinlang.org logo
#coroutines
Title
# coroutines
a

Adriano Celentano

09/17/2019, 7:54 AM
unfortunately i dont get the full stacktrace of my exception in my coroutine, are there better solutions than what i improvised so far ?
Copy code
val trace = Thread.currentThread().stackTrace
    val handler = CoroutineExceptionHandler { _, throwable ->
        throwable.stackTrace += trace
        result(Result.failure(throwable))
    }
a

Adriano Celentano

09/17/2019, 8:18 AM
sounds like a good idea 😄
but how to get it in release enivronment ?
g

gildor

09/17/2019, 8:23 AM
It’s fast enough to use for prod
See: https://github.com/Kotlin/kotlinx.coroutines/blob/master/docs/debugging.md#debug-mode
Overhead of this feature is negligible and it can be safely turned on by default to simplify logging and diagnostic.
Debug mode and stack recovery can be used on prod, but not debug agent
a

Adriano Celentano

09/17/2019, 8:50 AM
@gildor thank you very much 👍
👍 1
3 Views