1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-09-11 12:02:35 +02:00

Fixed: Logging full error message to database

This commit is contained in:
Mark McDowall 2017-06-10 16:25:14 -07:00
parent d7cb5090fc
commit d0e226e269
No known key found for this signature in database
GPG Key ID: D4CEFA9A718052E0
12 changed files with 43 additions and 41 deletions

View File

@ -68,7 +68,7 @@ private Response DownloadRelease(ReleaseResource release)
}
catch (ReleaseDownloadException ex)
{
_logger.Error(ex);
_logger.Error(ex, ex.Message);
throw new NzbDroneClientException(HttpStatusCode.Conflict, "Getting release from indexer failed");
}

View File

@ -191,12 +191,13 @@ private ValidationFailure TestConnection()
}
catch (DownloadClientAuthenticationException ex)
{
_logger.Error(ex);
_logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure("Password", "Authentication failed");
}
catch (WebException ex)
{
_logger.Error(ex);
_logger.Error(ex, "Unble to test connection");
switch (ex.Status)
{
case WebExceptionStatus.ConnectFailure:
@ -220,7 +221,7 @@ private ValidationFailure TestConnection()
}
catch (Exception ex)
{
_logger.Error(ex);
_logger.Error(ex, "Failed to test connection");
return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message);
}
@ -271,7 +272,7 @@ private ValidationFailure TestGetTorrents()
}
catch (Exception ex)
{
_logger.Error(ex);
_logger.Error(ex, "Unable to get torrents");
return new NzbDroneValidationFailure(string.Empty, "Failed to get the list of torrents: " + ex.Message);
}

View File

@ -320,12 +320,12 @@ protected ValidationFailure TestOutputPath()
}
catch (DownloadClientAuthenticationException ex) // User could not have permission to access to downloadstation
{
_logger.Error(ex);
_logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure(string.Empty, ex.Message);
}
catch (Exception ex)
{
_logger.Error(ex);
_logger.Error(ex, "Error testing Torrent Download Station");
return new NzbDroneValidationFailure(string.Empty, $"Unknown exception: {ex.Message}");
}
}
@ -346,7 +346,7 @@ protected ValidationFailure TestConnection()
}
catch (WebException ex)
{
_logger.Error(ex);
_logger.Error(ex, "Unable to connect to Torrent Download Station");
if (ex.Status == WebExceptionStatus.ConnectFailure)
{
@ -359,7 +359,7 @@ protected ValidationFailure TestConnection()
}
catch (Exception ex)
{
_logger.Error(ex);
_logger.Error(ex, "Error testing Torrent Download Station");
return new NzbDroneValidationFailure(string.Empty, $"Unknown exception: {ex.Message}");
}
}

View File

@ -234,12 +234,12 @@ protected ValidationFailure TestOutputPath()
}
catch (DownloadClientAuthenticationException ex) // User could not have permission to access to downloadstation
{
_logger.Error(ex);
_logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure(string.Empty, ex.Message);
}
catch (Exception ex)
{
_logger.Error(ex);
_logger.Error(ex, "Error testing Usenet Download Station");
return new NzbDroneValidationFailure(string.Empty, $"Unknown exception: {ex.Message}");
}
}
@ -260,7 +260,7 @@ protected ValidationFailure TestConnection()
}
catch (WebException ex)
{
_logger.Error(ex);
_logger.Error(ex, "Unable to connect to Usenet Download Station");
if (ex.Status == WebExceptionStatus.ConnectFailure)
{
@ -273,7 +273,7 @@ protected ValidationFailure TestConnection()
}
catch (Exception ex)
{
_logger.Error(ex);
_logger.Error(ex, "Error testing Torrent Download Station");
return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message);
}
}

View File

@ -168,7 +168,7 @@ private ValidationFailure TestConnection()
}
catch (Exception ex)
{
_logger.Error(ex);
_logger.Error(ex, "Unable to connect to NZBVortex");
return new ValidationFailure("Host", "Unable to connect to NZBVortex");
}
@ -189,7 +189,7 @@ private ValidationFailure TestApiVersion()
}
catch (Exception ex)
{
_logger.Error(ex);
_logger.Error(ex, "Unable to connect to NZBVortex");
return new ValidationFailure("Host", "Unable to connect to NZBVortex");
}

View File

@ -61,7 +61,7 @@ private IEnumerable<DownloadClientItem> GetQueue()
}
catch (DownloadClientException ex)
{
_logger.Error(ex);
_logger.Error(ex, ex.Message);
return Enumerable.Empty<DownloadClientItem>();
}
@ -127,7 +127,7 @@ private IEnumerable<DownloadClientItem> GetHistory()
}
catch (DownloadClientException ex)
{
_logger.Error(ex);
_logger.Error(ex, ex.Message);
return Enumerable.Empty<DownloadClientItem>();
}
@ -289,7 +289,7 @@ private ValidationFailure TestConnection()
{
return new ValidationFailure("Username", "Authentication failed");
}
_logger.Error(ex);
_logger.Error(ex, "Unable to connect to NZBGet");
return new ValidationFailure("Host", "Unable to connect to NZBGet");
}

View File

@ -99,7 +99,7 @@ public override IEnumerable<DownloadClientItem> GetItems()
}
catch (DownloadClientException ex)
{
_logger.Error(ex);
_logger.Error(ex, ex.Message);
return Enumerable.Empty<DownloadClientItem>();
}
@ -241,7 +241,7 @@ private ValidationFailure TestConnection()
}
catch (DownloadClientAuthenticationException ex)
{
_logger.Error(ex);
_logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure("Username", "Authentication failure")
{
DetailedDescription = "Please verify your username and password."
@ -249,7 +249,7 @@ private ValidationFailure TestConnection()
}
catch (WebException ex)
{
_logger.Error(ex);
_logger.Error(ex, "Unable to connect to qBittorrent");
if (ex.Status == WebExceptionStatus.ConnectFailure)
{
return new NzbDroneValidationFailure("Host", "Unable to connect")
@ -261,7 +261,7 @@ private ValidationFailure TestConnection()
}
catch (Exception ex)
{
_logger.Error(ex);
_logger.Error(ex, "Unable to test qBittorrent");
return new NzbDroneValidationFailure(String.Empty, "Unknown exception: " + ex.Message);
}
@ -296,7 +296,7 @@ private ValidationFailure TestPrioritySupport()
}
catch (Exception ex)
{
_logger.Error(ex);
_logger.Error(ex, "Failed to test qBittorrent");
return new NzbDroneValidationFailure(String.Empty, "Unknown exception: " + ex.Message);
}
@ -311,7 +311,7 @@ private ValidationFailure TestGetTorrents()
}
catch (Exception ex)
{
_logger.Error(ex);
_logger.Error(ex, "Failed to get torrents");
return new NzbDroneValidationFailure(String.Empty, "Failed to get the list of torrents: " + ex.Message);
}

View File

@ -57,7 +57,7 @@ private IEnumerable<DownloadClientItem> GetQueue()
}
catch (DownloadClientException ex)
{
_logger.Warn("Couldn't get download queue. {0}", ex.Message);
_logger.Warn(ex, "Couldn't get download queue. {0}", ex.Message);
return Enumerable.Empty<DownloadClientItem>();
}
@ -120,7 +120,8 @@ private IEnumerable<DownloadClientItem> GetHistory()
}
catch (DownloadClientException ex)
{
_logger.Error(ex);
_logger.Warn(ex, "Couldn't get download queue. {0}", ex.Message);
return Enumerable.Empty<DownloadClientItem>();
}
@ -388,7 +389,7 @@ private ValidationFailure TestConnectionAndVersion()
}
catch (Exception ex)
{
_logger.Error(ex);
_logger.Error(ex, ex.Message);
return new ValidationFailure("Host", "Unable to connect to SABnzbd");
}
}

View File

@ -41,7 +41,7 @@ public override IEnumerable<DownloadClientItem> GetItems()
}
catch (DownloadClientException ex)
{
_logger.Error(ex);
_logger.Error(ex, ex.Message);
return Enumerable.Empty<DownloadClientItem>();
}
@ -205,7 +205,7 @@ protected ValidationFailure TestConnection()
}
catch (DownloadClientAuthenticationException ex)
{
_logger.Error(ex);
_logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure("Username", "Authentication failure")
{
DetailedDescription = string.Format("Please verify your username and password. Also verify if the host running Sonarr isn't blocked from accessing {0} by WhiteList limitations in the {0} configuration.", Name)
@ -213,7 +213,7 @@ protected ValidationFailure TestConnection()
}
catch (DownloadClientUnavailableException ex)
{
_logger.Error(ex);
_logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure("Host", "Unable to connect")
{
@ -222,7 +222,7 @@ protected ValidationFailure TestConnection()
}
catch (Exception ex)
{
_logger.Error(ex);
_logger.Error(ex, "Failed to test");
return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message);
}
}
@ -237,7 +237,7 @@ private ValidationFailure TestGetTorrents()
}
catch (Exception ex)
{
_logger.Error(ex);
_logger.Error(ex, "Failed to get torrents");
return new NzbDroneValidationFailure(string.Empty, "Failed to get the list of torrents: " + ex.Message);
}

View File

@ -140,7 +140,7 @@ public override IEnumerable<DownloadClientItem> GetItems()
}
catch (DownloadClientException ex)
{
_logger.Error(ex);
_logger.Error(ex, ex.Message);
return Enumerable.Empty<DownloadClientItem>();
}
@ -189,7 +189,7 @@ private ValidationFailure TestConnection()
}
catch (Exception ex)
{
_logger.Error(ex);
_logger.Error(ex, "Failed to test rTorrent");
return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message);
}
@ -204,7 +204,7 @@ private ValidationFailure TestGetTorrents()
}
catch (Exception ex)
{
_logger.Error(ex);
_logger.Error(ex, "Failed to get torrents");
return new NzbDroneValidationFailure(string.Empty, "Failed to get the list of torrents: " + ex.Message);
}

View File

@ -105,7 +105,7 @@ public override IEnumerable<DownloadClientItem> GetItems()
}
catch (DownloadClientException ex)
{
_logger.Error(ex);
_logger.Error(ex, ex.Message);
return Enumerable.Empty<DownloadClientItem>();
}
@ -232,7 +232,7 @@ private ValidationFailure TestConnection()
}
catch (DownloadClientAuthenticationException ex)
{
_logger.Error(ex);
_logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure("Username", "Authentication failure")
{
DetailedDescription = "Please verify your username and password."
@ -240,7 +240,7 @@ private ValidationFailure TestConnection()
}
catch (WebException ex)
{
_logger.Error(ex);
_logger.Error(ex, "Unable to connect to uTorrent");
if (ex.Status == WebExceptionStatus.ConnectFailure)
{
return new NzbDroneValidationFailure("Host", "Unable to connect")
@ -252,7 +252,7 @@ private ValidationFailure TestConnection()
}
catch (Exception ex)
{
_logger.Error(ex);
_logger.Error(ex, "Failed to test uTorrent");
return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message);
}
@ -267,7 +267,7 @@ private ValidationFailure TestGetTorrents()
}
catch (Exception ex)
{
_logger.Error(ex);
_logger.Error(ex, "Failed to get torrents");
return new NzbDroneValidationFailure(string.Empty, "Failed to get the list of torrents: " + ex.Message);
}

View File

@ -48,7 +48,7 @@ private void ExecuteCommands()
}
catch (ThreadAbortException ex)
{
_logger.Error(ex);
_logger.Error(ex, "Thread aborted");
Thread.ResetAbort();
}
catch (Exception ex)