Skip to content

Error parameter in express middleware #1907

Answered by RobinTail
brandonk3nt asked this question in Q&A
Discussion options

You must be logged in to vote

In express-zod-api that job is carried out by ResultHandler.
The errors happened in endpoint handlers, middlewares, IO validation — will be handled by the ResultHandler assigned to the EndpointsFactory those endpoints produced at.
Parsing errors and 404 errors are handled by the ResultHandler assigned to errorHandler in your config (by default it's defaultResultHandler), @brandonk3nt

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by RobinTail
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants