enhance(client): show readable error when rate limit exceeded
This commit is contained in:
parent
e1159e9ef2
commit
92136272b0
3 changed files with 7 additions and 1 deletions
|
@ -20,7 +20,10 @@ export const apiWithDialog = ((
|
|||
promiseDialog(promise, null, (err) => {
|
||||
let title = null;
|
||||
let text = err.message + '\n' + (err as any).id;
|
||||
if (err.code.startsWith('TOO_MANY')) {
|
||||
if (err.code === 'RATE_LIMIT_EXCEEDED') {
|
||||
title = i18n.ts.cannotPerformTemporary;
|
||||
text = i18n.ts.cannotPerformTemporaryDescription;
|
||||
} else if (err.code.startsWith('TOO_MANY')) {
|
||||
title = i18n.ts.youCannotCreateAnymore;
|
||||
text = `${i18n.ts.error}: ${err.id}`;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue