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
parent 8fe93eae38
commit 05735ad2c3
5 changed files with 33 additions and 10 deletions

View File

@ -210,7 +210,7 @@ function FormInputGroup(props) {
key={index} key={index}
text={error.message} text={error.message}
link={error.link} link={error.link}
linkTooltip={error.detailedMessage} tooltip={error.detailedMessage}
isError={true} isError={true}
isCheckInput={checkInput} isCheckInput={checkInput}
/> />
@ -225,7 +225,7 @@ function FormInputGroup(props) {
key={index} key={index}
text={warning.message} text={warning.message}
link={warning.link} link={warning.link}
linkTooltip={warning.detailedMessage} tooltip={warning.detailedMessage}
isWarning={true} isWarning={true}
isCheckInput={checkInput} isCheckInput={checkInput}
/> />

View File

@ -37,3 +37,7 @@
margin-left: 5px; margin-left: 5px;
} }
.details {
margin-left: 5px;
}

View File

@ -11,7 +11,7 @@ function FormInputHelpText(props) {
className, className,
text, text,
link, link,
linkTooltip, tooltip,
isError, isError,
isWarning, isWarning,
isCheckInput isCheckInput
@ -28,16 +28,27 @@ function FormInputHelpText(props) {
{text} {text}
{ {
!!link && link ?
<Link <Link
className={styles.link} className={styles.link}
to={link} to={link}
title={linkTooltip} title={tooltip}
> >
<Icon <Icon
name={icons.EXTERNAL_LINK} name={icons.EXTERNAL_LINK}
/> />
</Link> </Link> :
null
}
{
!link && tooltip ?
<Icon
containerClassName={styles.details}
name={icons.INFO}
title={tooltip}
/> :
null
} }
</div> </div>
); );
@ -47,7 +58,7 @@ FormInputHelpText.propTypes = {
className: PropTypes.string.isRequired, className: PropTypes.string.isRequired,
text: PropTypes.string.isRequired, text: PropTypes.string.isRequired,
link: PropTypes.string, link: PropTypes.string,
linkTooltip: PropTypes.string, tooltip: PropTypes.string,
isError: PropTypes.bool, isError: PropTypes.bool,
isWarning: PropTypes.bool, isWarning: PropTypes.bool,
isCheckInput: PropTypes.bool isCheckInput: PropTypes.bool

View File

@ -376,7 +376,10 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd
catch (Exception ex) catch (Exception ex)
{ {
_logger.Error(ex, ex.Message); _logger.Error(ex, ex.Message);
return new ValidationFailure("Host", "Unable to connect to SABnzbd"); return new NzbDroneValidationFailure("Host", "Unable to connect to SABnzbd")
{
DetailedDescription = ex.Message
};
} }
} }

View File

@ -185,11 +185,16 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd
} }
catch (HttpException ex) 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) 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); CheckForError(response);