Sentry-dart: Exceptions not handled by user code should be `unhandled: true`

Created on 7 May 2021  路  4Comments  路  Source: getsentry/sentry-dart

Currently all exceptions are marked as handled.
This decision was made because exceptions in Flutter don't crash the app and thus sessions should not be marked as crashed.

Though we want to mark exceptions as unhandled to indicate that an exception caught by the root zone handler was not handled by the user.

There should be a way to differentiate.

This issue is a result of a discussion on Discord.

enhancement

Most helpful comment

I'll write down a DACI that introduces a new flag that would be added to the protocol, which would mean an unhandled error happened but it didn't crash the app, JS and RN have the same issue, this should consider the other platforms too.

All 4 comments

This problem is relevant to Unity too where unhandled errors (in C# scripts) also don't crash the process. But could render a blank screen

I don't see how this would be possible without changing our protocol, we also cannot forget that Flutter Apps can also crash in the native layer or if Flutter itself has a bug so we need 2 things.

handled by the user vs not handled by the user.
app didn't crash vs app crashed.

both things are already filterable via the mechanism btw.

I don't see how this would be possible without changing our protocol, we also cannot forget that Flutter Apps can also crash in the native layer or if Flutter itself has a bug so we need 2 things.

Similar to Unity. A handled: false if it came from a Mechanism other than the Unity error handler would mean a crash.

handled by the user vs not handled by the user.
app didn't crash vs app crashed.
both things are already filterable via the mechanism btw.

Let's discuss this again on the API evolution Thursday.

I'll write down a DACI that introduces a new flag that would be added to the protocol, which would mean an unhandled error happened but it didn't crash the app, JS and RN have the same issue, this should consider the other platforms too.

Was this page helpful?
0 / 5 - 0 ratings