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