mirror of
https://github.com/logto-io/logto.git
synced 2025-02-03 21:48:55 -05:00
Merge pull request #2204 from logto-io/charles-log-4430-the-unknown-server-error-failed-to-show-i18n-content
fix(console): show i18n content of "errors.unknown_server_error"
This commit is contained in:
commit
5cbb8cff5d
1 changed files with 4 additions and 2 deletions
|
@ -21,11 +21,13 @@ export class RequestError extends Error {
|
|||
}
|
||||
|
||||
const toastError = async (response: Response) => {
|
||||
const fallbackErrorMessage = t('admin_console.errors.unknown_server_error');
|
||||
|
||||
try {
|
||||
const data = await response.json<RequestErrorBody>();
|
||||
toast.error([data.message, data.details].join('\n') || t('errors.unknown_server_error'));
|
||||
toast.error([data.message, data.details].join('\n') || fallbackErrorMessage);
|
||||
} catch {
|
||||
toast.error(t('errors.unknown_server_error'));
|
||||
toast.error(fallbackErrorMessage);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue