New: (UI) Detailed error message for inner exception in indexers validation

This commit is contained in:
Bogdan
2024-06-01 13:44:35 +03:00
parent 468436b9f7
commit 6e01f3187a
4 changed files with 36 additions and 3 deletions

View File

@@ -1,3 +1,7 @@
.validationFailures {
margin-bottom: 20px;
}
.details {
margin-left: 5px;
}

View File

@@ -1,6 +1,7 @@
// This file is automatically generated.
// Please do not change this file!
interface CssExports {
'details': string;
'validationFailures': string;
}
export const cssExports: CssExports;

View File

@@ -1,7 +1,8 @@
import PropTypes from 'prop-types';
import React from 'react';
import Alert from 'Components/Alert';
import { kinds } from 'Helpers/Props';
import Icon from 'Components/Icon';
import { icons, kinds } from 'Helpers/Props';
import styles from './Form.css';
function Form(props) {
@@ -26,6 +27,16 @@ function Form(props) {
kind={kinds.DANGER}
>
{error.errorMessage}
{
error.detailedDescription ?
<Icon
containerClassName={styles.details}
name={icons.INFO}
title={error.detailedDescription}
/> :
null
}
</Alert>
);
})
@@ -39,6 +50,16 @@ function Form(props) {
kind={kinds.WARNING}
>
{warning.errorMessage}
{
warning.detailedDescription ?
<Icon
containerClassName={styles.details}
name={icons.INFO}
title={warning.detailedDescription}
/> :
null
}
</Alert>
);
})

View File

@@ -18,6 +18,7 @@ using NzbDrone.Core.Indexers.Exceptions;
using NzbDrone.Core.IndexerSearch.Definitions;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Validation;
using Polly;
using Polly.Retry;
@@ -814,7 +815,10 @@ namespace NzbDrone.Core.Indexers
{
_logger.Warn(ex, "Unable to connect to indexer");
return new ValidationFailure(string.Empty, "Unable to connect to indexer, please check your DNS settings and ensure IPv6 is working or disabled. " + ex.Message);
return new NzbDroneValidationFailure(string.Empty, "Unable to connect to indexer, please check your DNS settings and ensure IPv6 is working or disabled. " + ex.Message)
{
DetailedDescription = ex.InnerException?.Message
};
}
catch (TaskCanceledException ex)
{
@@ -841,7 +845,10 @@ namespace NzbDrone.Core.Indexers
{
_logger.Warn(ex, "Unable to connect to indexer");
return new ValidationFailure(string.Empty, "Unable to connect to indexer, check the log above the ValidationFailure for more details. " + ex.Message);
return new NzbDroneValidationFailure(string.Empty, "Unable to connect to indexer, check the log above the ValidationFailure for more details. " + ex.Message)
{
DetailedDescription = ex.InnerException?.Message
};
}
return null;