Skip to content

Commit

Permalink
Catch all exceptions when exiting process (#3530)
Browse files Browse the repository at this point in the history
  • Loading branch information
Evangelink authored Mar 30, 2022
1 parent a24324d commit 0dae437
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,11 @@ void InitializeAndStart()
await Task.Run(() => p.WaitForExit(), cts.Token);
#endif
}
catch (Exception ex) when (ex is InvalidOperationException or TaskCanceledException)
catch
{
// Ignore all exceptions thrown when asking for process to exit.
// We "expect" TaskCanceledException, COMException (if process was disposed before calling
// the exit) or InvalidOperationException.
}
}

Expand Down

0 comments on commit 0dae437

Please sign in to comment.