From b6f019b7f2d16d5c3ba4e51a4f7cd6f58b877c0a Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 23 Oct 2015 13:58:03 -0400 Subject: [PATCH] update store exception --- .../Security/PluginSecurityManager.cs | 27 ++++++++++++++++--- SharedVersion.cs | 4 +-- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs b/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs index e3a00efb5..ae3c43d7e 100644 --- a/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs +++ b/MediaBrowser.Common.Implementations/Security/PluginSecurityManager.cs @@ -211,8 +211,9 @@ namespace MediaBrowser.Common.Implementations.Security if (reg == null) { - _logger.Warn("Result from appstore registration was null. Defaulting to empty."); - reg = new RegRecord(); + var msg = "Result from appstore registration was null."; + _logger.Error(msg); + throw new ApplicationException(msg); } if (!String.IsNullOrEmpty(reg.key)) { @@ -221,17 +222,35 @@ namespace MediaBrowser.Common.Implementations.Security } } + catch (ApplicationException) + { + SaveAppStoreInfo(parameters); + throw; + } catch (Exception e) { _logger.ErrorException("Error registering appstore purchase {0}", e, parameters ?? "NO PARMS SENT"); - //Save all transaction information to a file - File.WriteAllText(Path.Combine(_appPaths.ProgramDataPath, "apptrans-error.txt"), parameters); + SaveAppStoreInfo(parameters); //TODO - could create a re-try routine on start-up if this file is there. For now we can handle manually. throw new ApplicationException("Error registering store sale"); } } + private void SaveAppStoreInfo(string info) + { + // Save all transaction information to a file + + try + { + File.WriteAllText(Path.Combine(_appPaths.ProgramDataPath, "apptrans-error.txt"), info); + } + catch (IOException) + { + + } + } + private async Task GetRegistrationStatusInternal(string feature, string mb2Equivalent = null, string version = null) diff --git a/SharedVersion.cs b/SharedVersion.cs index 8ac45ca4e..ab168e6ea 100644 --- a/SharedVersion.cs +++ b/SharedVersion.cs @@ -1,4 +1,4 @@ using System.Reflection; -//[assembly: AssemblyVersion("3.0.*")] -[assembly: AssemblyVersion("3.0.5768.5")] +[assembly: AssemblyVersion("3.0.*")] +//[assembly: AssemblyVersion("3.0.5768.5")]