Improve display of errors

This commit is contained in:
Adam Harvey
2021-02-02 23:27:20 -05:00
parent a06f9974f5
commit 5479e4eef0
4 changed files with 21 additions and 15 deletions
@@ -17,7 +17,6 @@ import React, { useState, useMemo, ReactNode } from 'react';
import { useLocalStorage, useAsync } from 'react-use';
import { useNavigate } from 'react-router-dom';
import { Grid, Button } from '@material-ui/core';
import Alert from '@material-ui/lab/Alert';
import Pagination from '@material-ui/lab/Pagination';
import {
InfoCard,
@@ -28,6 +27,7 @@ import {
HeaderLabel,
Progress,
useApi,
WarningPanel,
} from '@backstage/core';
import { lighthouseApiRef } from '../../api';
@@ -85,9 +85,9 @@ const AuditList = () => {
content = <Progress />;
} else if (error) {
content = (
<Alert severity="error" data-testid="error-message">
<WarningPanel severity="error" title="Could not load audit list.">
{error.message}
</Alert>
</WarningPanel>
);
}