Fixed: Show more information in UI when testing SAB fails in some cases

Signed-off-by: Robin Dadswell <robin@dadswell.email>
This commit is contained in:
Mark McDowall
2020-07-26 10:49:15 -07:00
committed by Qstick
parent b15ab3ae27
commit 1f88450045
5 changed files with 34 additions and 11 deletions
@@ -375,8 +375,11 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd
}
catch (Exception ex)
{
_logger.Error(ex, "Unable to authenticate");
return new ValidationFailure("Host", "Unable to connect to SABnzbd");
_logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure("Host", "Unable to connect to SABnzbd")
{
DetailedDescription = ex.Message
};
}
}
@@ -186,11 +186,16 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd
}
catch (HttpException ex)
{
throw new DownloadClientException("Unable to connect to SABnzbd, please check your settings", ex);
throw new DownloadClientException("Unable to connect to SABnzbd, {0}", ex, ex.Message);
}
catch (WebException ex)
{
throw new DownloadClientUnavailableException("Unable to connect to SABnzbd, please check your settings", ex);
if (ex.Status == WebExceptionStatus.TrustFailure)
{
throw new DownloadClientUnavailableException("Unable to connect to SABnzbd, certificate validation failed.", ex);
}
throw new DownloadClientUnavailableException("Unable to connect to SABnzbd, {0}", ex, ex.Message);
}
CheckForError(response);