🎨 proper error message body parser
This commit is contained in:
parent
d700e4c8fa
commit
4f67c2c86e
@ -148,8 +148,11 @@ export function instanceOf(
|
||||
})
|
||||
);
|
||||
}
|
||||
if (value instanceof type) return true;
|
||||
throw new FieldError("BASE_TYPE_CLASS", req.t("common:field.BASE_TYPE_CLASS", { type }));
|
||||
try {
|
||||
if (value instanceof type) return true;
|
||||
} catch (error) {
|
||||
throw new FieldError("BASE_TYPE_CLASS", req.t("common:field.BASE_TYPE_CLASS", { type }));
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof value !== "object") throw new FieldError("BASE_TYPE_OBJECT", req.t("common:field.BASE_TYPE_OBJECT"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user