zod-express-middleware icon indicating copy to clipboard operation
zod-express-middleware copied to clipboard

Unable to catch errors in express middleware

Open nicoandreoli2000 opened this issue 9 months ago • 2 comments

Description

When a validation fails, the library does this:

res.status(400).send(...)

When it should actually do this:

throw new ZodError(...)

If not, there's no way of parsing the errors to match different needs.

nicoandreoli2000 avatar May 25 '24 00:05 nicoandreoli2000