Add ErrorHandling.cs

This commit is contained in:
2024-07-19 08:35:34 -05:00
parent ddaa2df34e
commit 61044faf6f

9
ErrorHandling.cs Normal file
View File

@@ -0,0 +1,9 @@
// Catching All Errors in program.cs
// if (!Debugger.IsAttached) {
// if (!AppDomain.CurrentDomain.FriendlyName.EndsWith("vshost.exe")) {
if (!Debugger.IsAttached) {
Application.ThreadException += new ThreadExceptionEventHandler(HandleCrashes);
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(HandleCrashes);
}