diff --git a/src/TumblThree/TumblThree.Applications/Properties/Resources.Designer.cs b/src/TumblThree/TumblThree.Applications/Properties/Resources.Designer.cs index df10ae4..9e373f6 100644 --- a/src/TumblThree/TumblThree.Applications/Properties/Resources.Designer.cs +++ b/src/TumblThree/TumblThree.Applications/Properties/Resources.Designer.cs @@ -150,6 +150,15 @@ public static string Body { } } + /// + /// Looks up a localized string similar to Confirming the Tumblr privacy consent failed. There might a connection issue.. + /// + public static string ConfirmingTumblrPrivacyConsentFailed { + get { + return ResourceManager.GetString("ConfirmingTumblrPrivacyConsentFailed", resourceCulture); + } + } + /// /// Looks up a localized string similar to Conversation: {0}. /// @@ -729,7 +738,7 @@ public static string Textfile { } /// - /// Looks up a localized string similar to A connection timout occured during {0} of {1}.. + /// Looks up a localized string similar to A connection timeout occured during {0} of {1}.. /// public static string TimeoutReached { get { diff --git a/src/TumblThree/TumblThree.Applications/Properties/Resources.resx b/src/TumblThree/TumblThree.Applications/Properties/Resources.resx index 4c3b63f..56e1397 100644 --- a/src/TumblThree/TumblThree.Applications/Properties/Resources.resx +++ b/src/TumblThree/TumblThree.Applications/Properties/Resources.resx @@ -147,6 +147,9 @@ Body: {0] + + Confirming the Tumblr privacy consent failed. There might a connection issue. + Conversation: {0} @@ -342,7 +345,7 @@ Text file - A connection timout occured during {0} of {1}. + A connection timeout occured during {0} of {1}. Title: {0} diff --git a/src/TumblThree/TumblThree.Applications/Services/ConfirmTumblrPrivacyConsent.cs b/src/TumblThree/TumblThree.Applications/Services/ConfirmTumblrPrivacyConsent.cs index 22f6717..44d573f 100644 --- a/src/TumblThree/TumblThree.Applications/Services/ConfirmTumblrPrivacyConsent.cs +++ b/src/TumblThree/TumblThree.Applications/Services/ConfirmTumblrPrivacyConsent.cs @@ -1,10 +1,14 @@ using System; using System.Collections.Generic; using System.ComponentModel.Composition; +using System.Globalization; using System.Net; using System.Text.RegularExpressions; using System.Threading.Tasks; +using TumblThree.Applications.Properties; +using TumblThree.Domain; + namespace TumblThree.Applications.Services { [Export(typeof(IConfirmTumblrPrivacyConsent)), Export] @@ -25,6 +29,27 @@ public ConfirmTumblrPrivacyConsent(IShellService shellService, ISharedCookieServ } public async Task ConfirmPrivacyConsentAsync() + { + try + { + await PerformPrivacyConsentRequestAsync(); + } + catch (TimeoutException timeoutException) + { + const string message = "confirming the Tumblr privacy consent"; + Logger.Error("{0}, {1}", string.Format(CultureInfo.CurrentCulture, Resources.TimeoutReached, message), + timeoutException); + shellService.ShowError(timeoutException, Resources.TimeoutReached, message); + } + catch (Exception exception) + { + Logger.Error("{0}, {1}", string.Format(CultureInfo.CurrentCulture, Resources.ConfirmingTumblrPrivacyConsentFailed), + exception); + shellService.ShowError(exception, Resources.ConfirmingTumblrPrivacyConsentFailed); + } + } + + private async Task PerformPrivacyConsentRequestAsync() { if (CheckIfLoggedInAsync()) return;