touchlab / CrashKiOS

Crash reporting for Kotlin/Native iOS applications
https://crashkios.touchlab.co/
Apache License 2.0
258 stars 15 forks source link

Why not reporting Throwable's cause (if present)? #5

Closed matteobianchi3 closed 3 years ago

matteobianchi3 commented 3 years ago

Why not reporting Throwable's cause (if present) instead of the unhandled Throwable itself? For example, when unhandled exceptions are thrown from coroutines, we get "CoroutinesInternalError: Fatal exception in coroutines machinery..." reports instead of the actual cause of the exception (for example an IllegalStateException generated by a check(...) call); wouldn't it be more useful if the actual cause is reported?

matteobianchi3 commented 3 years ago

I've managed to do that by overriding the crash method of the iOS CrashHandler:

    override func crash(t: KotlinThrowable) {
        t.printStackTrace()
        super.crash(t: t.cause ?? t)
    }