-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
Description
Describe the bug
I enabled stack trace recovery with
System.setProperty("kotlinx.coroutines.stacktrace.recovery", "true")
in my project's Application class onCreate, but it does not seem to work for me no matter what I do.
For example this code:
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
runBlocking {
callerFunction1()
}
}
fun callerFunction1() {
CoroutineScope(Dispatchers.Main + CoroutineName("Caller1")).launch {
intermediateFunction1()
}
}
suspend fun intermediateFunction1() {
delay(100)
intermediateFunction3()
}
suspend fun intermediateFunction2() {
delay(100)
crashFunction()
}
will trim the stack trace only to crashFunction call without any callers info.
What I tried:
- Using Coroutine ExceptionHandler
- Using try-catch at the top level
- Using my CustomException which implements CopiableThrowable
- Using other types of exception like IllegalStateException
Environment
- Android
- Standard debug build - no Proguard or R8
- kotlin 2.0.0
- coroutinesVersion 1.8.1