DataDog / dd-sdk-kotlin-multiplatform

Datadog SDK for Kotlin Multiplatform
Apache License 2.0
4 stars 0 forks source link

RUM-5113: Catch and report unhandled Kotlin exceptions #39

Closed 0xnm closed 3 months ago

0xnm commented 3 months ago

What does this PR do?

This PR adds support of reporting unhandled KMP exceptions. They exist because in Swift there is no concept of unchecked exceptions, so if any Kotlin code throws to Swift, it should have @Throws annotation. If exception is not handled, then it is reported to what is set in unhandledExceptionHook and then application should be terminated.

If this hook is not implemented, we will still catch crash, but it will be less precise or may even miss the relevant information.

This PR will report such exceptions to Logs and RUM if crash reporting is enabled.

Review checklist (to be filled by reviewers)