sentry-dotnet
sentry-dotnet copied to clipboard
Consider `Mechanism.Handled` for non-thrown captured exceptions
The MainExceptionProcessor
handles setting the mechanism here: https://github.com/getsentry/sentry-dotnet/blob/c30052e99d981aec3d6ff1bda42c3395a2376fe7/src/Sentry/Internal/MainExceptionProcessor.cs#L177-L188
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?