Skip to content

Instantly share code, notes, and snippets.

View rodion-m's full-sized avatar
🤩
CodeAliving

Rodion Mostovoi rodion-m

🤩
CodeAliving
View GitHub Profile
@ronnieoverby
ronnieoverby / App.xaml.cs
Last active September 16, 2023 12:08
wpf global exception handling
// somewhere early in App.xaml.cs
AppDomain.CurrentDomain.UnhandledException += (s, e) =>
LogUnhandledException((Exception) e.ExceptionObject, "AppDomain.CurrentDomain.UnhandledException");
DispatcherUnhandledException += (s, e) =>
LogUnhandledException(e.Exception, "Application.Current.DispatcherUnhandledException");
TaskScheduler.UnobservedTaskException += (s, e) =>
LogUnhandledException(e.Exception, "TaskScheduler.UnobservedTaskException");