Reorder exception logging to reduce duplication
This commit is contained in:
@@ -190,21 +190,29 @@ quit";
|
||||
}
|
||||
|
||||
private void LogException(Exception ex)
|
||||
{
|
||||
{
|
||||
if (ex is AggregateException ag)
|
||||
{
|
||||
foreach (var e in ag.InnerExceptions)
|
||||
LogException(e);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Log.Fatal(ex);
|
||||
|
||||
if (ex is ReflectionTypeLoadException extl)
|
||||
{
|
||||
foreach (var exl in extl.LoaderExceptions)
|
||||
LogException(exl);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (ex.InnerException != null)
|
||||
{
|
||||
LogException(ex.InnerException);
|
||||
}
|
||||
|
||||
Log.Fatal(ex);
|
||||
|
||||
if (ex is ReflectionTypeLoadException exti)
|
||||
foreach (Exception exl in exti.LoaderExceptions)
|
||||
LogException(exl);
|
||||
|
||||
if (ex is AggregateException ag)
|
||||
foreach (Exception e in ag.InnerExceptions)
|
||||
LogException(e);
|
||||
}
|
||||
|
||||
private void HandleException(object sender, UnhandledExceptionEventArgs e)
|
||||
|
Reference in New Issue
Block a user