fixed error display
This commit is contained in:
parent
0449e563d8
commit
17a9cc67f2
@ -73,7 +73,7 @@ const Error = ({error, onDismiss}) => {
|
||||
{rs && <span> of <b>{rs.name}</b></span>}
|
||||
{errorStatus}.
|
||||
</p>
|
||||
<p>If this problem persist, we suggest you
|
||||
<p>If this problem persists, we suggest you
|
||||
try again later.</p>
|
||||
</div>
|
||||
);
|
||||
|
@ -33,15 +33,17 @@ const Status = ({routeServerId}) => {
|
||||
});
|
||||
}, [routeServerId, handleError]);
|
||||
|
||||
if (error && error.code >= 100 && error.code < 200) {
|
||||
const errorInfo = error?.response?.data;
|
||||
|
||||
if (errorInfo && errorInfo.tag === "CONNECTION_REFUSED") {
|
||||
return (
|
||||
<div className="routeserver-status">
|
||||
<div className="api-error">
|
||||
unreachable
|
||||
route server unreachable
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
} else if (error?.response?.data?.tag === "GENERIC_ERROR") {
|
||||
} else if (errorInfo && errorInfo.tag === "GENERIC_ERROR") {
|
||||
return (
|
||||
<div className="routeserver-status">
|
||||
<div className="api-error">
|
||||
@ -49,11 +51,11 @@ const Status = ({routeServerId}) => {
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
} else if (error) {
|
||||
} else if (errorInfo) {
|
||||
return (
|
||||
<div className="routeserver-status">
|
||||
<div className="api-error">
|
||||
{error.response?.data?.tag}
|
||||
{errorInfo.tag}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user