Fixed: Logging full error message to database

pull/94/head
Qstick 7 years ago
parent ad50be9daf
commit 0148f48913

@ -191,12 +191,12 @@ namespace NzbDrone.Core.Download.Clients.Deluge
}
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, "Unable to test connection");
switch (ex.Status)
{
case WebExceptionStatus.ConnectFailure:
@ -220,7 +220,7 @@ namespace NzbDrone.Core.Download.Clients.Deluge
}
catch (Exception ex)
{
_logger.Error(ex);
_logger.Error(ex, "Failed to test connection");
return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message);
}
@ -271,7 +271,7 @@ namespace NzbDrone.Core.Download.Clients.Deluge
}
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);
}

@ -320,12 +320,12 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
}
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 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
}
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 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
}
catch (Exception ex)
{
_logger.Error(ex);
_logger.Error(ex, "Error testing Torrent Download Station");
return new NzbDroneValidationFailure(string.Empty, $"Unknown exception: {ex.Message}");
}
}

@ -234,12 +234,12 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
}
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 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
}
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 @@ namespace NzbDrone.Core.Download.Clients.DownloadStation
}
catch (Exception ex)
{
_logger.Error(ex);
_logger.Error(ex, "Error testing Torrent Download Station");
return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message);
}
}

@ -169,7 +169,7 @@ namespace NzbDrone.Core.Download.Clients.NzbVortex
}
catch (Exception ex)
{
_logger.Error(ex);
_logger.Error(ex, "Unable to connect to NZBVortex");
return new ValidationFailure("Host", "Unable to connect to NZBVortex");
}
@ -190,7 +190,7 @@ namespace NzbDrone.Core.Download.Clients.NzbVortex
}
catch (Exception ex)
{
_logger.Error(ex);
_logger.Error(ex, "Unable to connect to NZBVortex");
return new ValidationFailure("Host", "Unable to connect to NZBVortex");
}

@ -61,7 +61,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget
}
catch (DownloadClientException ex)
{
_logger.Error(ex);
_logger.Error(ex, ex.Message);
return Enumerable.Empty<DownloadClientItem>();
}
@ -127,7 +127,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget
}
catch (DownloadClientException ex)
{
_logger.Error(ex);
_logger.Error(ex, ex.Message);
return Enumerable.Empty<DownloadClientItem>();
}
@ -289,7 +289,7 @@ namespace NzbDrone.Core.Download.Clients.Nzbget
{
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");
}

@ -99,7 +99,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
}
catch (DownloadClientException ex)
{
_logger.Error(ex);
_logger.Error(ex, ex.Message);
return Enumerable.Empty<DownloadClientItem>();
}
@ -241,7 +241,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
}
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 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
}
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 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
}
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 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
}
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 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
}
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);
}

@ -57,7 +57,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd
}
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,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd
}
catch (DownloadClientException ex)
{
_logger.Error(ex);
_logger.Warn(ex, "Couldn't get download queue. {0}", ex.Message);
return Enumerable.Empty<DownloadClientItem>();
}
@ -387,7 +387,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd
}
catch (Exception ex)
{
_logger.Error(ex);
_logger.Error(ex, ex.Message);
return new ValidationFailure("Host", "Unable to connect to SABnzbd");
}
}

@ -41,7 +41,7 @@ namespace NzbDrone.Core.Download.Clients.Transmission
}
catch (DownloadClientException ex)
{
_logger.Error(ex);
_logger.Error(ex, ex.Message);
return Enumerable.Empty<DownloadClientItem>();
}
@ -205,7 +205,7 @@ namespace NzbDrone.Core.Download.Clients.Transmission
}
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 Lidarr isn't blocked from accessing {0} by WhiteList limitations in the {0} configuration.", Name)
@ -213,7 +213,7 @@ namespace NzbDrone.Core.Download.Clients.Transmission
}
catch (WebException ex)
{
_logger.Error(ex);
_logger.Error(ex, ex.Message);
if (ex.Status == WebExceptionStatus.ConnectFailure)
{
return new NzbDroneValidationFailure("Host", "Unable to connect")
@ -225,7 +225,7 @@ namespace NzbDrone.Core.Download.Clients.Transmission
}
catch (Exception ex)
{
_logger.Error(ex);
_logger.Error(ex, "Failed to test");
return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message);
}
}
@ -240,7 +240,7 @@ namespace NzbDrone.Core.Download.Clients.Transmission
}
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);
}

@ -140,7 +140,7 @@ namespace NzbDrone.Core.Download.Clients.RTorrent
}
catch (DownloadClientException ex)
{
_logger.Error(ex);
_logger.Error(ex, ex.Message);
return Enumerable.Empty<DownloadClientItem>();
}
@ -189,7 +189,7 @@ namespace NzbDrone.Core.Download.Clients.RTorrent
}
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 @@ namespace NzbDrone.Core.Download.Clients.RTorrent
}
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);
}

@ -105,7 +105,7 @@ namespace NzbDrone.Core.Download.Clients.UTorrent
}
catch (DownloadClientException ex)
{
_logger.Error(ex);
_logger.Error(ex, ex.Message);
return Enumerable.Empty<DownloadClientItem>();
}
@ -232,7 +232,7 @@ namespace NzbDrone.Core.Download.Clients.UTorrent
}
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 @@ namespace NzbDrone.Core.Download.Clients.UTorrent
}
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 @@ namespace NzbDrone.Core.Download.Clients.UTorrent
}
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 @@ namespace NzbDrone.Core.Download.Clients.UTorrent
}
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);
}

@ -48,7 +48,7 @@ namespace NzbDrone.Core.Messaging.Commands
}
catch (ThreadAbortException ex)
{
_logger.Error(ex);
_logger.Error(ex, "Thread aborted");
Thread.ResetAbort();
}
catch (Exception ex)

Loading…
Cancel
Save