Print stack trace of an exception in Kotlinx.Coroutine
kotlin/coroutine/exception-handler
By default, Kotlinx.Coroutine will not print stack trace of an exception. This snippet will print stack trace of an exception.
1fun CoroutineExceptionHandler(key: String) = kotlinx.coroutines.CoroutineExceptionHandler { _, exception ->
2    logger.error("$key coroutine uncaught exception", exception)
3}
Unauthorized reproduction of original content on this website is prohibited.