Skip to content

Commit

Permalink
Fixed "Ignore Exception" button not re-connecting the device or re-st…
Browse files Browse the repository at this point in the history
…arting the update loop
  • Loading branch information
jorticus committed Aug 18, 2015
1 parent 371897e commit 76cebaa
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions App.xaml.cs
Expand Up @@ -110,20 +110,27 @@ void Dispatcher_UnhandledException(object sender, System.Windows.Threading.Dispa
{
try
{
Exception outer_ex = e.Exception;
Exception ex = e.Exception;

// If exception occurred in another thread
if (e.Exception is System.Reflection.TargetInvocationException && e.Exception.InnerException != null)
{
ex = e.Exception.InnerException;
outer_ex = e.Exception.InnerException;
}

if (ex is TimerException)
ex = ex.InnerException;

ExceptionDialog.ShowException(null, ex, ExceptionSeverity.Unhandled);

// Re-enable timer if Ignoring the exception
if (ex is TimerException && (ex as TimerException).Timer.Enabled == false)
(ex as TimerException).Timer.Start();
if (outer_ex is TimerException && (outer_ex as TimerException).Timer.Enabled == false)
{
(outer_ex as TimerException).Timer.Start();
connectTimer.Start();
}

e.Handled = true;
}
Expand Down

0 comments on commit 76cebaa

Please sign in to comment.