diff --git a/DiscordChatExporter.Gui/App.xaml b/DiscordChatExporter.Gui/App.xaml index c456ec8..de9d06c 100644 --- a/DiscordChatExporter.Gui/App.xaml +++ b/DiscordChatExporter.Gui/App.xaml @@ -4,6 +4,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:converters="clr-namespace:DiscordChatExporter.Gui.Converters" xmlns:local="clr-namespace:DiscordChatExporter.Gui" + DispatcherUnhandledException="App_OnDispatcherUnhandledException" StartupUri="Views/MainWindow.xaml"> diff --git a/DiscordChatExporter.Gui/App.xaml.cs b/DiscordChatExporter.Gui/App.xaml.cs index 57df507..d5158a8 100644 --- a/DiscordChatExporter.Gui/App.xaml.cs +++ b/DiscordChatExporter.Gui/App.xaml.cs @@ -1,6 +1,13 @@ -namespace DiscordChatExporter.Gui +using System.Windows; +using System.Windows.Threading; + +namespace DiscordChatExporter.Gui { public partial class App { + private void App_OnDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs args) + { + MessageBox.Show(args.Exception.ToString(), "Error occured", MessageBoxButton.OK, MessageBoxImage.Error); + } } } \ No newline at end of file