summaryrefslogtreecommitdiff
path: root/grapher/Program.cs
diff options
context:
space:
mode:
authora1xd <[email protected]>2021-03-11 07:00:19 -0500
committerGitHub <[email protected]>2021-03-11 07:00:19 -0500
commit11b62cfcf58dbf9b0e5328f2bf283864185e95be (patch)
tree1d401f7d99570cb0e560944af52167060295bf8b /grapher/Program.cs
parentMerge pull request #71 from a1xd/fix-dev-id (diff)
parentadd handler for unhandled exceptions (diff)
downloadrawaccel-1.4.3.tar.xz
rawaccel-1.4.3.zip
Merge pull request #81 from a1xd/log-unhandled-exv1.4.3
add handler for unhandled exceptions
Diffstat (limited to 'grapher/Program.cs')
-rw-r--r--grapher/Program.cs13
1 files changed, 11 insertions, 2 deletions
diff --git a/grapher/Program.cs b/grapher/Program.cs
index 485e074..894d1cd 100644
--- a/grapher/Program.cs
+++ b/grapher/Program.cs
@@ -19,11 +19,20 @@ namespace grapher
return;
}
+ AppDomain.CurrentDomain.UnhandledException += GlobalUnhandledExceptionHandler;
+
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new RawAcceleration());
-
- GC.KeepAlive(mutex);
+
+ GC.KeepAlive(mutex);
+ }
+
+ static void GlobalUnhandledExceptionHandler(object sender, UnhandledExceptionEventArgs e)
+ {
+ var ex = (Exception)e.ExceptionObject;
+ System.IO.File.WriteAllText("error.log", ex.ToString());
+ MessageBox.Show(ex.Message, "Error");
}
}
}