Manoel Aranda Neto

Results 1021 comments of Manoel Aranda Neto

``` val handler = SentryCoroutineExceptionHandler { _, exception -> // ideally we create an event with a mechanism Sentry.captureException(exception) } val job = GlobalScope.launch(handler) { throw AssertionError() } ```

examples can be found on https://github.com/Kotlin/kotlinx.coroutines/tree/master/kotlinx-coroutines-core/jvm/test/guide example-exceptions-{number}-kt files

works like a try/catch, if no `CoroutineExceptionHandler` is given, `UncaughtExceptionHandlerIntegration` gets called and crashes the App, but if a `CoroutineExceptionHandler` is given, it gets caught and swallowed, so its a...

one thing to note is: > [CoroutineExceptionHandler] can be invoked from an arbitrary thread so we cannot use the current thread when creating a `ExceptionMechanismException`

``` public object SentryCoroutineExceptionHandler : AbstractCoroutineContextElement(CoroutineExceptionHandler), CoroutineExceptionHandler { override fun handleException(context: CoroutineContext, exception: Throwable) { val mechanism = Mechanism().apply { // null and true is the same // isHandled =...

related topic https://kt.academy/article/cc-exception-handling

Consider testing https://github.com/Anamorphosee/stacktrace-decoroutinator and adding to the docs if it gives better stack traces

As I understood, this is already done on iOS for every transaction, since they don't need the instance of the view such as `activity`.

> Ideally, we could find a way to save all these values in Sentry so that we could retrieve them later and query them in any possible way That could...

> Depending on how you want to do this, there might be multiple builds trying to write their result to the file at the same time. Not sure we need...