diff --git a/DeliCounter/Backend/Services/DiagnosticInfoCollector.cs b/DeliCounter/Backend/Services/DiagnosticInfoCollector.cs index 40ac793..b1b2829 100644 --- a/DeliCounter/Backend/Services/DiagnosticInfoCollector.cs +++ b/DeliCounter/Backend/Services/DiagnosticInfoCollector.cs @@ -207,13 +207,17 @@ public bool ContainsAnyModdedFiles(string installFolder) private void CurrentDomainOnUnhandledException(object sender, UnhandledExceptionEventArgs e) { if (Debugger.IsAttached) return; - - Exception ex = (Exception)e.ExceptionObject; - Exception inner = ex; - while (ex.InnerException is not null) inner = ex.InnerException; if (e.IsTerminating) { + Exception ex = (Exception)e.ExceptionObject; + Exception inner = ex; + while (ex.InnerException is not null) + { + if (IgnoredExceptions.Contains(inner.GetType())) return; + inner = ex.InnerException; + } + // If this exception is not ignored, send it to sentry if (!IgnoredExceptions.Contains(inner.GetType())) {