Created
May 12, 2014 06:35
-
-
Save RhysC/79b9ba632dc878ddae7b to your computer and use it in GitHub Desktop.
Events that you should be using to get UnhandledExceptions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// .NET/CLR app domains | |
// You - always want to be logging these errors! | |
AppDomain.CurrentDomain.UnhandledException += (s,e) => {}; | |
// Framework specific handlers | |
System.Windows.Application.Current.DispatcherUnhandledException += (s,e) => {}; // WPF | |
System.Windows.Forms.Application.ThreadException += (s,e) => {}; // Windows Forms | |
System.Threading.Tasks.TaskScheduler.UnobservedTaskException += (s,e) => {}; // TPL - not really very imporant | |
// ASP.NET (i'm guessing you hook into this in your Global.asx?) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment