Missing Exceptions

We are experiencing issues with Sentry where certain exceptions are not propagated into Sentry, - more specifically we catch the exception and log some information to the local file system, but do not find any trace of it in Sentry.
This setup works perfectly well for all other exceptions, - hundreds of different exception types, but for a small group of exception types this does not seem to work as intended.

We have been investigating any and all possible causes and eliminated config issues and whatnot being the culprit. What we do see, is a what we believe might be a pattern shared between these problematic exception types, a pattern that amounts to thread abortion and the like. We are talking about TaskCancelled, catastrophic runtime failure causing the process to die in the hardest possible way, ThreadAbort and so on.

Our hypothesis is that the process and/or thread that is supposed to submit the exception/event to Sentry dies before the submission is completed – while the file system logging is fast enough to do its job before the process/thread is dead. We are in a Windows environment, C#, .Net, and are using Sentry SDK for .Net for the submission.
Assuming that our hypothesis is correct, do you have any advice for how to remedy or workaround this phenomenon?

What version of the SDK?

Have you tried enabling the SDK debug mode? You can do it with options.Debug=true:

You didn’t mention the app model, so if there’s no console (i.e WinForms) you can change the logger:

while the file system logging is fast enough to do its job before the process/thread is dead.

The SDK has offline caching support: Basic Options for .NET | Sentry Documentation

It does flush events before returning from an unhandled exception but in general it expects that you flush events before exiting:

Other than that sounds like this something we’d need a repro so we can look into more details

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.