add error handler
This commit is contained in:
@@ -259,7 +259,8 @@ export async function registration(
|
||||
break;
|
||||
|
||||
case 2:
|
||||
typedError.message_body.fieldErrors.forEach((obj: {
|
||||
if (typedError.message_body?.fieldErrors) {
|
||||
typedError.message_body?.fieldErrors?.forEach((obj: {
|
||||
code: string,
|
||||
field: string
|
||||
}) => {
|
||||
@@ -269,6 +270,10 @@ export async function registration(
|
||||
errors[obj.field] = obj.code.replaceAll('.', '-');
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
errors['server'] = 'unknown-error'
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -274,6 +274,7 @@
|
||||
"register-error-password-not-allowed-symbols": "Password contains invalid characters.",
|
||||
"confirmation-code": "Confirmation code",
|
||||
"enter-confirmation-code": "Enter the confirmation code",
|
||||
"personal": "Personal"
|
||||
"personal": "Personal",
|
||||
"unknown-error": "Unknown error"
|
||||
}
|
||||
}
|
||||
@@ -274,6 +274,7 @@
|
||||
"register-error-password-not-allowed-symbols": "Пароль содержит недопустимые символы.",
|
||||
"confirmation-code": "Код подтверждения",
|
||||
"enter-confirmation-code": "Введите код подтверждения",
|
||||
"personal": "Личный"
|
||||
"personal": "Личный",
|
||||
"unknown-error": "Неизвестная ошибка"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user