add error handler
This commit is contained in:
+15
-10
@@ -259,16 +259,21 @@ export async function registration(
|
||||
break;
|
||||
|
||||
case 2:
|
||||
typedError.message_body.fieldErrors.forEach((obj: {
|
||||
code: string,
|
||||
field: string
|
||||
}) => {
|
||||
if (errors[obj.field]) {
|
||||
errors[obj.field] = `${errors[obj.field]}&${obj.code.replaceAll('.', '-')}`;
|
||||
} else {
|
||||
errors[obj.field] = obj.code.replaceAll('.', '-');
|
||||
}
|
||||
});
|
||||
if (typedError.message_body?.fieldErrors) {
|
||||
typedError.message_body?.fieldErrors?.forEach((obj: {
|
||||
code: string,
|
||||
field: string
|
||||
}) => {
|
||||
if (errors[obj.field]) {
|
||||
errors[obj.field] = `${errors[obj.field]}&${obj.code.replaceAll('.', '-')}`;
|
||||
} else {
|
||||
errors[obj.field] = obj.code.replaceAll('.', '-');
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
errors['server'] = 'unknown-error'
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user