Update Program.cs (#2589)

This commit is contained in:
Sebastian Göls
2022-05-25 17:18:06 +02:00
committed by GitHub
parent d6a2f53ab0
commit b83f8fc669

View File

@@ -476,10 +476,7 @@ internal static class Program {
private static async void OnUnhandledException(object? sender, UnhandledExceptionEventArgs e) {
ArgumentNullException.ThrowIfNull(e);
if (e.ExceptionObject == null) {
throw new ArgumentNullException(nameof(e));
}
ArgumentNullException.ThrowIfNull(e.ExceptionObject);
await ASF.ArchiLogger.LogFatalException((Exception) e.ExceptionObject).ConfigureAwait(false);
await Exit(1).ConfigureAwait(false);
@@ -487,10 +484,7 @@ internal static class Program {
private static async void OnUnobservedTaskException(object? sender, UnobservedTaskExceptionEventArgs e) {
ArgumentNullException.ThrowIfNull(e);
if (e.Exception == null) {
throw new ArgumentNullException(nameof(e));
}
ArgumentNullException.ThrowIfNull(e.Exception);
await ASF.ArchiLogger.LogFatalException(e.Exception).ConfigureAwait(false);