1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-10-06 08:07:20 +02:00

Better error messaging when connecting to nzbget fails

This commit is contained in:
Mark McDowall 2014-02-27 07:07:02 -08:00
parent 669f351d08
commit 98858bd237

View File

@ -59,7 +59,7 @@ private IRestClient BuildClient(NzbgetSettings settings)
{ {
var protocol = settings.UseSsl ? "https" : "http"; var protocol = settings.UseSsl ? "https" : "http";
var url = String.Format("{0}//{1}:{2}/jsonrpc", var url = String.Format("{0}://{1}:{2}/jsonrpc",
protocol, protocol,
settings.Host, settings.Host,
settings.Port); settings.Port);
@ -85,13 +85,13 @@ private void CheckForError(IRestResponse response)
{ {
if (response.ResponseStatus != ResponseStatus.Completed) if (response.ResponseStatus != ResponseStatus.Completed)
{ {
throw new ApplicationException("Unable to connect to NzbGet, please check your settings"); throw new DownloadClientException("Unable to connect to NzbGet, please check your settings");
} }
var result = Json.Deserialize<JsonError>(response.Content); var result = Json.Deserialize<JsonError>(response.Content);
if (result.Error != null) if (result.Error != null)
throw new ApplicationException(result.Error.ToString()); throw new DownloadClientException("Error response received from nzbget: {0}", result.Error.ToString());
} }
} }
} }