Skip to content

Commit

Permalink
added a global backup exception-handling
Browse files Browse the repository at this point in the history
  • Loading branch information
dadul96 committed Aug 1, 2019
1 parent 31bcb16 commit 9307b41
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions FileRenamer/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:FileRenamer"
DispatcherUnhandledException="Application_DispatcherUnhandledException"
StartupUri="MainWindow.xaml">
<Application.Resources>

Expand Down
5 changes: 5 additions & 0 deletions FileRenamer/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,10 @@ namespace FileRenamer
/// </summary>
public partial class App : Application
{
private void Application_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
MessageBox.Show("An unhandled exception just occurred: " + e.Exception.Message, "Global backup exception catcher", MessageBoxButton.OK, MessageBoxImage.Warning);
e.Handled = true;
}
}
}

0 comments on commit 9307b41

Please sign in to comment.