Resetting errors and removing duplicates (#56054)
This commit is contained in:
parent
8c2980213e
commit
9685eca401
|
@ -16,17 +16,27 @@ import {
|
|||
import { FormattedMessage } from '@kbn/i18n/react';
|
||||
|
||||
const ErrorList = ({ errors }) => {
|
||||
return errors.map((error, errorIndex) => {
|
||||
const { message, statusCode, error: friendlyName } = error;
|
||||
return (
|
||||
<Fragment key={`checker-error-${errorIndex}`}>
|
||||
<EuiDescriptionListTitle>
|
||||
{statusCode} {friendlyName}
|
||||
</EuiDescriptionListTitle>
|
||||
<EuiDescriptionListDescription>{message}</EuiDescriptionListDescription>
|
||||
</Fragment>
|
||||
);
|
||||
});
|
||||
const errorsMap = {};
|
||||
return errors
|
||||
.filter(err => {
|
||||
const { statusCode, error, message } = err;
|
||||
const key = `${statusCode}${error}${message}`;
|
||||
if (!errorsMap[key]) {
|
||||
errorsMap[key] = true;
|
||||
return true;
|
||||
}
|
||||
})
|
||||
.map((error, errorIndex) => {
|
||||
const { message, statusCode, error: friendlyName } = error;
|
||||
return (
|
||||
<Fragment key={`checker-error-${errorIndex}`}>
|
||||
<EuiDescriptionListTitle>
|
||||
{statusCode} {friendlyName}
|
||||
</EuiDescriptionListTitle>
|
||||
<EuiDescriptionListDescription>{message}</EuiDescriptionListDescription>
|
||||
</Fragment>
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
export function CheckerErrors(props) {
|
||||
|
|
|
@ -45,6 +45,7 @@ export class NoDataController extends MonitoringViewBaseController {
|
|||
}
|
||||
}
|
||||
|
||||
this.errors.length = 0;
|
||||
if (catchReason) {
|
||||
this.reason = catchReason;
|
||||
} else if (!this.isCollectionEnabledUpdating && !this.isCollectionIntervalUpdating) {
|
||||
|
|
Loading…
Reference in a new issue