Add ErrorHandling.cs
This commit is contained in:
9
ErrorHandling.cs
Normal file
9
ErrorHandling.cs
Normal 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);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user