mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-14 05:03:09 +02:00
enhance(client): improve api error handling
This commit is contained in:
parent
6a5bbd335b
commit
6159cfd138
2 changed files with 5 additions and 0 deletions
|
@ -940,6 +940,8 @@ cannotPerformTemporaryDescription: "操作回数が制限を超過するため
|
||||||
preset: "プリセット"
|
preset: "プリセット"
|
||||||
selectFromPresets: "プリセットから選択"
|
selectFromPresets: "プリセットから選択"
|
||||||
achievements: "実績"
|
achievements: "実績"
|
||||||
|
gotInvalidResponseError: "サーバーの応答が無効です"
|
||||||
|
gotInvalidResponseErrorDescription: "サーバーがダウンまたはメンテナンスしている可能性があります。しばらくしてから再度お試しください。"
|
||||||
|
|
||||||
_achievements:
|
_achievements:
|
||||||
earnedAt: "獲得日時"
|
earnedAt: "獲得日時"
|
||||||
|
|
|
@ -35,6 +35,9 @@ export const apiWithDialog = ((
|
||||||
} else if (err.code.startsWith('TOO_MANY')) {
|
} else if (err.code.startsWith('TOO_MANY')) {
|
||||||
title = i18n.ts.youCannotCreateAnymore;
|
title = i18n.ts.youCannotCreateAnymore;
|
||||||
text = `${i18n.ts.error}: ${err.id}`;
|
text = `${i18n.ts.error}: ${err.id}`;
|
||||||
|
} else if (err.message.startsWith('Unexpected token')) {
|
||||||
|
title = i18n.ts.gotInvalidResponseError;
|
||||||
|
text = i18n.ts.gotInvalidResponseErrorDescription;
|
||||||
}
|
}
|
||||||
alert({
|
alert({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
|
|
Loading…
Reference in a new issue