mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
better error messages when download client connection fails
This commit is contained in:
parent
690569cbbc
commit
dcf434abd3
@ -191,9 +191,9 @@ private IRestRequest BuildRequest(JsonRequest jsonRequest)
|
||||
|
||||
private void CheckForError(IRestResponse response)
|
||||
{
|
||||
if (response.ResponseStatus != ResponseStatus.Completed)
|
||||
if (response.ErrorException != null)
|
||||
{
|
||||
throw new DownloadClientException("Unable to connect to NzbGet, please check your settings", response.ErrorException);
|
||||
throw new DownloadClientException("Unable to connect to NzbGet. " + response.ErrorException.Message, response.ErrorException);
|
||||
}
|
||||
|
||||
if (response.StatusCode == System.Net.HttpStatusCode.Unauthorized)
|
||||
|
@ -15,9 +15,9 @@ public DownloadClientCheck(IProvideDownloadClient downloadClientProvider)
|
||||
|
||||
public override HealthCheck Check()
|
||||
{
|
||||
var downloadClients = _downloadClientProvider.GetDownloadClients();
|
||||
var downloadClients = _downloadClientProvider.GetDownloadClients().ToList();
|
||||
|
||||
if (downloadClients.Count() == 0)
|
||||
if (!downloadClients.Any())
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Warning, "No download client is available");
|
||||
}
|
||||
@ -29,9 +29,9 @@ public override HealthCheck Check()
|
||||
downloadClient.GetItems();
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
catch (Exception e)
|
||||
{
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, "Unable to communicate with download client");
|
||||
return new HealthCheck(GetType(), HealthCheckResult.Error, "Unable to communicate with download client " + e.Message);
|
||||
}
|
||||
|
||||
return new HealthCheck(GetType());
|
||||
|
Loading…
Reference in New Issue
Block a user