mirror of
https://github.com/logto-io/logto.git
synced 2025-01-20 21:32:31 -05:00
fix(console): show i18n content of "errors.unknown_server_error"
This commit is contained in:
parent
7fc0f43699
commit
f355ecbbc9
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