From 6b3e102899ec90dfdba92476c30eff70a6ee0905 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Sun, 22 Apr 2012 16:30:18 -0700 Subject: [PATCH] Updated exceptrack driver's url, made test more effective. --- NzbDrone.Common/ReportingService.cs | 10 +++++++--- .../Integeration/ServiceIntegerationFixture.cs | 4 +++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/NzbDrone.Common/ReportingService.cs b/NzbDrone.Common/ReportingService.cs index 19340ab3f..31bc457e8 100644 --- a/NzbDrone.Common/ReportingService.cs +++ b/NzbDrone.Common/ReportingService.cs @@ -57,7 +57,7 @@ namespace NzbDrone.Common } } - public static void ReportException(LogEventInfo logEvent) + public static string ReportException(LogEventInfo logEvent) { try { @@ -69,7 +69,7 @@ namespace NzbDrone.Common exceptionData.Location = logEvent.LoggerName; exceptionData.UserId = EnvironmentProvider.UGuid.ToString().Replace("-", string.Empty); - ExceptrackDriver.SubmitException(exceptionData); + return ExceptrackDriver.SubmitException(exceptionData); } catch (Exception e) { @@ -81,6 +81,8 @@ namespace NzbDrone.Common //this shouldn't log an exception since it will cause a recursive loop. logger.Info("Unable to report exception. " + e); } + + return null; } @@ -89,7 +91,9 @@ namespace NzbDrone.Common ExceptrackDriver = new ExceptionClient( "CB230C312E5C4FF38B4FB9644B05E60D", new EnvironmentProvider().Version.ToString(), - new Uri("http://api.exceptrack.com/")); + new Uri("http://api.exceptrack.com/v1/")); + + ExceptrackDriver.ThrowsExceptions = !EnvironmentProvider.IsProduction; } private static void VerifyDependencies() diff --git a/NzbDrone.Core.Test/Integeration/ServiceIntegerationFixture.cs b/NzbDrone.Core.Test/Integeration/ServiceIntegerationFixture.cs index fe8efa30a..9e95e5365 100644 --- a/NzbDrone.Core.Test/Integeration/ServiceIntegerationFixture.cs +++ b/NzbDrone.Core.Test/Integeration/ServiceIntegerationFixture.cs @@ -65,7 +65,9 @@ namespace NzbDrone.Core.Test.Integeration log.Exception = new ArgumentOutOfRangeException(); log.Message = "New message string. New message string. New message string. New message string. New message string. New message string."; - ReportingService.ReportException(log); + var hash = ReportingService.ReportException(log); + + hash.Should().HaveLength(8); }