diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/App.xaml.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/App.xaml.cs index 184f10ccd6..c63e237446 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/App.xaml.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/App.xaml.cs @@ -60,7 +60,12 @@ private void App_DispatcherUnhandledException(object sender, System.Windows.Thre { ((MainWindow)MainWindow).AppWebView.Services.GetRequiredService().Handle(e.Exception); } - catch { } + catch + { + var errorMessage = e.Exception.ToString(); + System.Windows.Clipboard.SetText(errorMessage); + System.Windows.Forms.MessageBox.Show(errorMessage, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + } e.Handled = true; } diff --git a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Program.cs b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Program.cs index 93d598b664..c70eb840a3 100644 --- a/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Program.cs +++ b/src/Templates/Boilerplate/Bit.Boilerplate/src/Client/Boilerplate.Client.Windows/Program.cs @@ -24,11 +24,11 @@ public static void Main(string[] args) var application = new App(); Task.Run(async () => { + var services = await App.Current.Dispatcher.InvokeAsync(() => ((MainWindow)App.Current.MainWindow).AppWebView.Services); try { - var services = await App.Current.Dispatcher.InvokeAsync(() => ((MainWindow)App.Current.MainWindow).AppWebView.Services); var windowsUpdateSettings = services.GetRequiredService>().Value; - if (windowsUpdateSettings?.FilesUrl is null) + if (string.IsNullOrEmpty(windowsUpdateSettings?.FilesUrl)) { return; } @@ -43,7 +43,10 @@ public static void Main(string[] args) } } } - catch { } + catch (Exception exp) + { + services.GetRequiredService().Handle(exp); + } }); application.Run(); }