mirror of
https://github.com/spacebarchat/server.git
synced 2024-09-22 02:31:36 +02:00
🎨 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;
|
try {
|
||||||
throw new FieldError("BASE_TYPE_CLASS", req.t("common:field.BASE_TYPE_CLASS", { type }));
|
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"));
|
if (typeof value !== "object") throw new FieldError("BASE_TYPE_OBJECT", req.t("common:field.BASE_TYPE_OBJECT"));
|
||||||
|
Loading…
Reference in New Issue
Block a user