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

This commit is contained in:
Mark McDowall 2020-07-26 10:49:15 -07:00 committed by Qstick
commit 2f3888f5ed
5 changed files with 34 additions and 11 deletions

View file

@ -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
};
}
}

View file

@ -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);