add error handler

This commit is contained in:
smanylov
2026-01-30 23:02:18 +07:00
parent c5baec6d1d
commit b4249c7f38
3 changed files with 19 additions and 12 deletions
+6 -1
View File
@@ -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:
+2 -1
View File
@@ -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"
}
}
+2 -1
View File
@@ -274,6 +274,7 @@
"register-error-password-not-allowed-symbols": "Пароль содержит недопустимые символы.",
"confirmation-code": "Код подтверждения",
"enter-confirmation-code": "Введите код подтверждения",
"personal": "Личный"
"personal": "Личный",
"unknown-error": "Неизвестная ошибка"
}
}