Skip to content
This repository has been archived by the owner on Jul 28, 2021. It is now read-only.

Commit

Permalink
Hopefully ignored some errors properly
Browse files Browse the repository at this point in the history
  • Loading branch information
nrgill28 committed May 20, 2021
1 parent 0708c60 commit 78a4abb
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions DeliCounter/Backend/Services/DiagnosticInfoCollector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
{
Expand Down

0 comments on commit 78a4abb

Please sign in to comment.