From 8d33d8f216126235acc61f4a21d9f80175a0c788 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 19 Aug 2016 18:42:27 -0400 Subject: [PATCH] Catch task cancellation of App.cs syncs --- src/App/App.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/App/App.cs b/src/App/App.cs index 874fd3f5a..940473ca1 100644 --- a/src/App/App.cs +++ b/src/App/App.cs @@ -145,6 +145,11 @@ namespace Bit.App } attempt++; } + catch(Exception e) when(e is TaskCanceledException || e is OperationCanceledException) + { + Debug.WriteLine("Cancellation exception."); + break; + } } while(attempt <= 1); } else @@ -178,8 +183,17 @@ namespace Bit.App } attempt++; } + catch(Exception e) when(e is TaskCanceledException || e is OperationCanceledException) + { + Debug.WriteLine("Cancellation exception."); + break; + } } while(attempt <= 1); } + else + { + Debug.WriteLine("Not connected."); + } } private async void Logout(string logoutMessage)