Skip to content

Commit

Permalink
Avoid terminating the process if not mandatory
Browse files Browse the repository at this point in the history
  • Loading branch information
JustArchi committed Oct 4, 2024
1 parent d074f47 commit 92456aa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ArchiSteamFarm/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,10 @@ private static async void OnUnhandledException(object? sender, UnhandledExceptio
ArgumentNullException.ThrowIfNull(e.ExceptionObject);

await ASF.ArchiLogger.LogFatalException((Exception) e.ExceptionObject).ConfigureAwait(false);
await Exit(1).ConfigureAwait(false);

if (e.IsTerminating) {
await Exit(1).ConfigureAwait(false);
}
}

private static async void OnUnobservedTaskException(object? sender, UnobservedTaskExceptionEventArgs e) {
Expand Down

0 comments on commit 92456aa

Please sign in to comment.