The MainExceptionProcessor handles setting the mechanism here:
|
else if (exception.StackTrace != null) |
|
{ |
|
// The exception was thrown, but it was caught by the user, not an integration. |
|
// Thus, we can mark it as handled. |
|
mechanism.Handled = true; |
|
} |
|
else |
|
{ |
|
// The exception was never thrown. It was just constructed and then captured. |
|
// Thus, it is neither handled nor unhandled. |
|
mechanism.Handled = null; |
|
} |
So this code ends up with Handled = true
try
{
throw new Exception();
}
catch (Exception ex)
{
// will be marked as handled
SentrySdk.CaptureException(ex);
}
And this code ends up with Handled -- in the issue's Highlights
// will not be marked as anything
SentrySdk.CaptureException(new Exception());

Interestingly, captured messages are Handled -- too.
Which, personally, I find confusing. If an exception is not unhandled, should we not consider it handled implicitly? I'm not talking technical correctness here but user expectations.
But I can still filter issues based on error.handled:false so maybe it doesn't matter?
Tip
tldr; see #3383 (comment)
The
MainExceptionProcessorhandles setting the mechanism here:sentry-dotnet/src/Sentry/Internal/MainExceptionProcessor.cs
Lines 177 to 188 in c30052e
So this code ends up with
Handled = trueAnd this code ends up with
Handled --in the issue'sHighlightsInterestingly, captured messages are
Handled --too.Which, personally, I find confusing. If an exception is not
unhandled, should we not consider ithandledimplicitly? I'm not talking technical correctness here but user expectations.But I can still filter issues based on
error.handled:falseso maybe it doesn't matter?