Add WebException handlers to prevent them reaching the UI.

pull/6/head
Taloth Saldono 9 years ago
parent 2d96914bfa
commit 1154e0eeb3

@ -229,6 +229,10 @@ namespace NzbDrone.Core.Download.Clients.Deluge
throw new DownloadClientException("Unable to connect to Deluge, please check your settings", ex);
}
}
catch (WebException ex)
{
throw new DownloadClientException("Unable to connect to Deluge, please check your settings", ex);
}
}
private void AuthenticateClient(JsonRpcRequestBuilder requestBuilder, DelugeSettings settings, bool reauthenticate = false)

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Net;
using Newtonsoft.Json;
using NLog;
using NzbDrone.Common.Cache;
@ -158,6 +159,10 @@ namespace NzbDrone.Core.Download.Clients.NzbVortex
{
throw new DownloadClientException("Unable to connect to NZBVortex, please check your settings", ex);
}
catch (WebException ex)
{
throw new DownloadClientException("Unable to connect to NZBVortex, please check your settings", ex);
}
}
private void AuthenticateClient(HttpRequestBuilder requestBuilder, NzbVortexSettings settings, bool reauthenticate = false)

@ -174,6 +174,10 @@ namespace NzbDrone.Core.Download.Clients.Nzbget
throw new DownloadClientException("Unable to connect to NzbGet. " + ex.Message, ex);
}
catch (WebException ex)
{
throw new DownloadClientException("Unable to connect to NzbGet. " + ex.Message, ex);
}
_logger.Trace("Response: {0}", response.Content);

@ -5,6 +5,7 @@ using NzbDrone.Common.Extensions;
using NzbDrone.Common.Serializer;
using NzbDrone.Core.Download.Clients.Sabnzbd.Responses;
using NzbDrone.Common.Http;
using System.Net;
namespace NzbDrone.Core.Download.Clients.Sabnzbd
{
@ -167,6 +168,10 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd
{
throw new DownloadClientException("Unable to connect to SABnzbd, please check your settings", ex);
}
catch (WebException ex)
{
throw new DownloadClientException("Unable to connect to SABnzbd, please check your settings", ex);
}
_logger.Trace("Response: {0}", response.Content);

@ -160,9 +160,13 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
}
else
{
throw new DownloadClientException("Failed to connect to download client", ex);
throw new DownloadClientException("Failed to connect to qBitTorrent, check your settings.", ex);
}
}
catch (WebException ex)
{
throw new DownloadClientException("Failed to connect to qBitTorrent, please check your settings.", ex);
}
return Json.Deserialize<TResult>(response.Content);
}
@ -201,7 +205,11 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent
throw new DownloadClientAuthenticationException("Failed to authenticate with qbitTorrent.", ex);
}
throw;
throw new DownloadClientException("Failed to connect to qBitTorrent, please check your settings.", ex);
}
catch (WebException ex)
{
throw new DownloadClientException("Failed to connect to qBitTorrent, please check your settings.", ex);
}
if (response.Content != "Ok.") // returns "Fails." on bad login

@ -193,6 +193,10 @@ namespace NzbDrone.Core.Download.Clients.UTorrent
throw new DownloadClientException("Unable to connect to Deluge, please check your settings", ex);
}
}
catch (WebException ex)
{
throw new DownloadClientException("Unable to connect to Deluge, please check your settings", ex);
}
return Json.Deserialize<UTorrentResponse>(response.Content);
}
@ -230,7 +234,11 @@ namespace NzbDrone.Core.Download.Clients.UTorrent
throw new DownloadClientAuthenticationException("Failed to authenticate with uTorrent.");
}
throw;
throw new DownloadClientException("Unable to connect to uTorrent, please check your settings", ex);
}
catch (WebException ex)
{
throw new DownloadClientException("Unable to connect to uTorrent, please check your settings", ex);
}
cookies = response.GetCookies();

Loading…
Cancel
Save