message: Handled UnobservedTaskException and UnhandledException
diff: using Microsoft.Extensions.Hosting;
  using Microsoft.Extensions.Logging;
  using Sqlbi.Bravo.Core;
  +using Sqlbi.Bravo.Core.Helpers;
  using Sqlbi.Bravo.Core.Logging;
  using Sqlbi.Bravo.Core.Services.Interfaces;
  using Sqlbi.Bravo.Core.Settings.Interfaces;
  using Sqlbi.Bravo.Core.Windows;
  using Sqlbi.Bravo.UI.Services.Interfaces;
  using System;
  +using System.Diagnostics;
  using System.Threading.Tasks;
  using System.Windows;
  @@ -68,20 +70,25 @@ namespace Sqlbi.Bravo
  TaskScheduler.UnobservedTaskException += (s, e) =>
  {
  var exception = e.Exception;
  +
  _logger.Error(LogEvents.TaskSchedulerUnobservedTaskException, exception);
  +
  MessageBox.Show(exception.Message, AppConstants.ApplicationNameLabel, MessageBoxButton.OK, MessageBoxImage.Error);
  - // TODO REQUIREMENTS?: SetObserved for UnobservedTaskException
  - //e.SetObserved();
  + if (exception.IsSafeException())
  + {
  + e.SetObserved();
  + }
  };
  - //if (!Debugger.IsAttached)
  + if (Debugger.IsAttached == false)
  {
  AppDomain.CurrentDomain.UnhandledException += (s, e) =>
  {
  if (e.ExceptionObject is Exception exception)
  {
  _logger.Error(LogEvents.AppDomainUnhandledException, exception);
  +
  MessageBox.Show(exception.Message, AppConstants.ApplicationNameLabel, MessageBoxButton.OK, MessageBoxImage.Error);
  }
  };
  @@ -89,11 +96,15 @@ namespace Sqlbi.Bravo
  Dispatcher.UnhandledException += (s, e) =>
  {
  var exception = e.Exception;
  +
  _logger.Error(LogEvents.DispatcherUnhandledException, exception);
  +
  MessageBox.Show(exception.Message, AppConstants.ApplicationNameLabel, MessageBoxButton.OK, MessageBoxImage.Error);
  - // TODO REQUIREMENTS: Handled for UnhandledException
  - //e.Handled = true;
  + if (exception.IsSafeException())
  + {
  + e.Handled = true;
  + }
  };
  }
  }
  @@ -110,7 +121,6 @@ namespace Sqlbi.Bravo
  else
  {
  application.NotifyConnectionToPrimaryInstance();
  -
  Shutdown();
  }
  }
  