mirror of
https://github.com/Lidarr/Lidarr
synced 2026-01-04 14:44:55 +01:00
Fixed: Show TLS errors in UI when testing download clients
This commit is contained in:
parent
1baf415924
commit
e912ef6a3e
17 changed files with 91 additions and 13 deletions
|
|
@ -267,7 +267,11 @@ private ValidationFailure TestConnection()
|
|||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(ex, "Failed to test connection");
|
||||
return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message);
|
||||
|
||||
return new NzbDroneValidationFailure("Host", "Unable to connect to Deluge")
|
||||
{
|
||||
DetailedDescription = ex.Message
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -266,6 +266,11 @@ private JsonRpcResponse<TResult> ExecuteRequest<TResult>(JsonRpcRequestBuilder r
|
|||
}
|
||||
catch (WebException ex)
|
||||
{
|
||||
if (ex.Status == WebExceptionStatus.TrustFailure)
|
||||
{
|
||||
throw new DownloadClientUnavailableException("Unable to connect to Deluge, certificate validation failed.", ex);
|
||||
}
|
||||
|
||||
throw new DownloadClientUnavailableException("Unable to connect to Deluge, please check your settings", ex);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,6 +85,11 @@ private DiskStationResponse<T> ProcessRequest<T>(HttpRequestBuilder requestBuild
|
|||
}
|
||||
catch (WebException ex)
|
||||
{
|
||||
if (ex.Status == WebExceptionStatus.TrustFailure)
|
||||
{
|
||||
throw new DownloadClientUnavailableException("Unable to connect to Diskstation, certificate validation failed.", ex);
|
||||
}
|
||||
|
||||
throw new DownloadClientUnavailableException("Unable to connect to Diskstation, please check your settings", ex);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -388,7 +388,11 @@ protected ValidationFailure TestConnection()
|
|||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(ex, "Error testing Torrent Download Station");
|
||||
return new NzbDroneValidationFailure(string.Empty, $"Unknown exception: {ex.Message}");
|
||||
|
||||
return new NzbDroneValidationFailure("Host", "Unable to connect to Torrent Download Station")
|
||||
{
|
||||
DetailedDescription = ex.Message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -286,7 +286,11 @@ protected ValidationFailure TestConnection()
|
|||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(ex, "Error testing Torrent Download Station");
|
||||
return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message);
|
||||
|
||||
return new NzbDroneValidationFailure("Host", "Unable to connect to Usenet Download Station")
|
||||
{
|
||||
DetailedDescription = ex.Message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -158,7 +158,8 @@ private ValidationFailure TestConnection()
|
|||
|
||||
if (version < new Version("5.1"))
|
||||
{
|
||||
return new ValidationFailure(string.Empty, "Old Hadouken client with unsupported API, need 5.1 or higher");
|
||||
return new ValidationFailure(string.Empty,
|
||||
"Old Hadouken client with unsupported API, need 5.1 or higher");
|
||||
}
|
||||
}
|
||||
catch (DownloadClientAuthenticationException ex)
|
||||
|
|
@ -167,6 +168,13 @@ private ValidationFailure TestConnection()
|
|||
|
||||
return new NzbDroneValidationFailure("Password", "Authentication failed");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new NzbDroneValidationFailure("Host", "Unable to connect to Hadouken")
|
||||
{
|
||||
DetailedDescription = ex.Message
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,6 +90,11 @@ private T ProcessRequest<T>(HadoukenSettings settings, string method, params obj
|
|||
}
|
||||
catch (WebException ex)
|
||||
{
|
||||
if (ex.Status == WebExceptionStatus.TrustFailure)
|
||||
{
|
||||
throw new DownloadClientUnavailableException("Unable to connect to Hadouken, certificate validation failed.", ex);
|
||||
}
|
||||
|
||||
throw new DownloadClientUnavailableException("Unable to connect to Hadouken, please check your settings", ex);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -163,7 +163,11 @@ private ValidationFailure TestConnection()
|
|||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(ex, "Unable to connect to NZBVortex");
|
||||
return new ValidationFailure("Host", "Unable to connect to NZBVortex");
|
||||
|
||||
return new NzbDroneValidationFailure("Host", "Unable to connect to NZBVortex")
|
||||
{
|
||||
DetailedDescription = ex.Message
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -165,6 +165,11 @@ private T ProcessRequest<T>(HttpRequestBuilder requestBuilder, bool requiresAuth
|
|||
}
|
||||
catch (WebException ex)
|
||||
{
|
||||
if (ex.Status == WebExceptionStatus.TrustFailure)
|
||||
{
|
||||
throw new DownloadClientUnavailableException("Unable to connect to NZBVortex, certificate validation failed.", ex);
|
||||
}
|
||||
|
||||
throw new DownloadClientUnavailableException("Unable to connect to NZBVortex, please check your settings", ex);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -381,7 +381,11 @@ private ValidationFailure TestConnection()
|
|||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(ex, "Unable to test qBittorrent");
|
||||
return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message);
|
||||
|
||||
return new NzbDroneValidationFailure("Host", "Unable to connect to qBittorrent")
|
||||
{
|
||||
DetailedDescription = ex.Message
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -54,6 +54,11 @@ public bool IsApiSupported(QBittorrentSettings settings)
|
|||
}
|
||||
catch (WebException ex)
|
||||
{
|
||||
if (ex.Status == WebExceptionStatus.TrustFailure)
|
||||
{
|
||||
throw new DownloadClientUnavailableException("Unable to connect to qBittorrent, certificate validation failed.", ex);
|
||||
}
|
||||
|
||||
throw new DownloadClientException("Failed to connect to qBittorrent, check your settings.", ex);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -261,15 +261,17 @@ protected ValidationFailure TestConnection()
|
|||
}
|
||||
catch (DownloadClientUnavailableException ex)
|
||||
{
|
||||
_logger.Error(ex, "Unable to connect to transmission");
|
||||
return new NzbDroneValidationFailure("Host", "Unable to connect")
|
||||
{
|
||||
DetailedDescription = "Please verify the hostname and port."
|
||||
};
|
||||
_logger.Error(ex, ex.Message);
|
||||
|
||||
return new NzbDroneValidationFailure("Host", "Unable to connect to Transmission")
|
||||
{
|
||||
DetailedDescription = ex.Message
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(ex, "Failed to test");
|
||||
|
||||
return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -308,6 +308,11 @@ public TransmissionResponse ProcessRequest(string action, object arguments, Tran
|
|||
}
|
||||
catch (WebException ex)
|
||||
{
|
||||
if (ex.Status == WebExceptionStatus.TrustFailure)
|
||||
{
|
||||
throw new DownloadClientUnavailableException("Unable to connect to Transmission, certificate validation failed.", ex);
|
||||
}
|
||||
|
||||
throw new DownloadClientUnavailableException("Unable to connect to Transmission, please check your settings", ex);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -208,7 +208,11 @@ private ValidationFailure TestConnection()
|
|||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(ex, "Failed to test rTorrent");
|
||||
return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message);
|
||||
|
||||
return new NzbDroneValidationFailure("Host", "Unable to connect to rTorrent")
|
||||
{
|
||||
DetailedDescription = ex.Message
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -264,6 +264,11 @@ private T ExecuteRequest<T>(Func<T> task)
|
|||
}
|
||||
catch (WebException ex)
|
||||
{
|
||||
if (ex.Status == WebExceptionStatus.TrustFailure)
|
||||
{
|
||||
throw new DownloadClientUnavailableException("Unable to connect to rTorrent, certificate validation failed.", ex);
|
||||
}
|
||||
|
||||
throw new DownloadClientUnavailableException("Unable to connect to rTorrent, please check your settings", ex);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -291,7 +291,11 @@ private ValidationFailure TestConnection()
|
|||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(ex, "Failed to test uTorrent");
|
||||
return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message);
|
||||
|
||||
return new NzbDroneValidationFailure("Host", "Unable to connect to uTorrent")
|
||||
{
|
||||
DetailedDescription = ex.Message
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -231,6 +231,11 @@ public UTorrentResponse ProcessRequest(HttpRequestBuilder requestBuilder, UTorre
|
|||
}
|
||||
catch (WebException ex)
|
||||
{
|
||||
if (ex.Status == WebExceptionStatus.TrustFailure)
|
||||
{
|
||||
throw new DownloadClientUnavailableException("Unable to connect to uTorrent, certificate validation failed.", ex);
|
||||
}
|
||||
|
||||
throw new DownloadClientException("Unable to connect to uTorrent, please check your settings", ex);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue