From d2557b4be509cf4452dfa379dbb17d4ca1b6242d Mon Sep 17 00:00:00 2001 From: pizzaboxer <41478239+pizzaboxer@users.noreply.github.com> Date: Sat, 11 Feb 2023 19:21:20 +0000 Subject: [PATCH] Add error handling for new bootstrapper handler --- Bloxstrap/App.xaml.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Bloxstrap/App.xaml.cs b/Bloxstrap/App.xaml.cs index 569cd76..472ccef 100644 --- a/Bloxstrap/App.xaml.cs +++ b/Bloxstrap/App.xaml.cs @@ -181,7 +181,18 @@ namespace Bloxstrap bootstrapper.Dialog = dialog; } - Task bootstrapperTask = Task.Run(() => bootstrapper.Run()); + Task bootstrapperTask = Task.Run(() => bootstrapper.Run()).ContinueWith(t => + { + if (t.Exception is null) + return; + +#if DEBUG + throw t.Exception; +#else + dialog?.ShowError(t.Exception.ToString()); +#endif + }); + dialog?.ShowBootstrapper(); bootstrapperTask.Wait(); }