Skip to content

Commit

Permalink
Added global exceptionhandling
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKert committed Apr 5, 2019
1 parent d43a806 commit c0d8a8b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/BuildVision/Core/BuildVisionPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Threading;
using System.Windows;
using System.Windows.Threading;
using BuildVision.Common.Diagnostics;
using BuildVision.Exports.Providers;
using BuildVision.Exports.Services;
using BuildVision.Helpers;
Expand Down Expand Up @@ -62,14 +63,13 @@ public BuildVisionPackage()

if (Application.Current != null)
{
Application.Current.DispatcherUnhandledException += Current_DispatcherUnhandledException; ;
Application.Current.DispatcherUnhandledException += Current_DispatcherUnhandledException;
}
}

private void Current_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{
MessageBox.Show($"Diagnostics mode caught and marked as handled the following DispatcherUnhandledException raised in Visual Studio: {e.Exception}.");
e.Handled = true;
DiagnosticsClient.Notify(e.Exception);
}

protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress)
Expand Down

0 comments on commit c0d8a8b

Please sign in to comment.