Skip to content
Snippets Groups Projects
Commit 6159cfd1 authored by syuilo's avatar syuilo
Browse files

enhance(client): improve api error handling

parent 6a5bbd33
No related branches found
No related tags found
No related merge requests found
......@@ -940,6 +940,8 @@ cannotPerformTemporaryDescription: "操作回数が制限を超過するため
preset: "プリセット"
selectFromPresets: "プリセットから選択"
achievements: "実績"
gotInvalidResponseError: "サーバーの応答が無効です"
gotInvalidResponseErrorDescription: "サーバーがダウンまたはメンテナンスしている可能性があります。しばらくしてから再度お試しください。"
_achievements:
earnedAt: "獲得日時"
......
......@@ -35,6 +35,9 @@ export const apiWithDialog = ((
} else if (err.code.startsWith('TOO_MANY')) {
title = i18n.ts.youCannotCreateAnymore;
text = `${i18n.ts.error}: ${err.id}`;
} else if (err.message.startsWith('Unexpected token')) {
title = i18n.ts.gotInvalidResponseError;
text = i18n.ts.gotInvalidResponseErrorDescription;
}
alert({
type: 'error',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment