mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-16 11:05:56 +08:00
chore: error detail is updated
This commit is contained in:
parent
6f48030ab9
commit
4b591fabf7
@ -75,14 +75,17 @@ function ErrorDetails(): JSX.Element {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// if errorType and serviceName is null redirecting to the ALL_ERROR page not now
|
||||||
if (errorType === null || serviceName === null) {
|
if (errorType === null || serviceName === null) {
|
||||||
return <Redirect to={ROUTES.ALL_ERROR} />;
|
return <Redirect to={ROUTES.ALL_ERROR} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// when the api is in loading state
|
||||||
if (status === 'loading' || ErrorIdStatus === 'loading') {
|
if (status === 'loading' || ErrorIdStatus === 'loading') {
|
||||||
return <Spinner tip="Loading.." />;
|
return <Spinner tip="Loading.." />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if any error occurred while loading
|
||||||
if (status === 'error' || ErrorIdStatus === 'error') {
|
if (status === 'error' || ErrorIdStatus === 'error') {
|
||||||
return (
|
return (
|
||||||
<Typography>
|
<Typography>
|
||||||
@ -91,9 +94,10 @@ function ErrorDetails(): JSX.Element {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if API is successfully but there is an error
|
||||||
if (
|
if (
|
||||||
(status === 'success' && data?.statusCode !== 200) ||
|
(status === 'success' && data?.statusCode >= 400) ||
|
||||||
(ErrorIdStatus === 'success' && errorIdPayload.statusCode !== 200)
|
(ErrorIdStatus === 'success' && errorIdPayload.statusCode >= 400)
|
||||||
) {
|
) {
|
||||||
return <Typography>{data?.error || defaultError}</Typography>;
|
return <Typography>{data?.error || defaultError}</Typography>;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user