Skip to content

Commit

Permalink
feat(dcellar-web-ui): add 429 status text
Browse files Browse the repository at this point in the history
  • Loading branch information
aiden-cao committed Sep 13, 2023
1 parent 998097c commit 767bcec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions apps/dcellar-web-ui/src/facade/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ export const createTxFault = (e: any): ErrorResponse => {
) {
return [null, E_OFF_CHAIN_AUTH];
}
if ((e as any).statusCode === 429) {
return [null, 'SP not available. Try later.'];
}
return [null, e?.message || E_UNKNOWN_ERROR];
};

Expand Down
2 changes: 1 addition & 1 deletion apps/dcellar-web-ui/src/facade/object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ export const getObjectMeta = async (
},
(e) => {
const error =
e.status !== 429
e.status === 429
? { code: e.status, message: 'SP not available. Try later.' }
: xmlParser.parse(e.data);
return commonFault(error);
Expand Down

0 comments on commit 767bcec

Please sign in to comment.