Skip to content
Discussion options

You must be logged in to vote

Hello, @jakub-msqt .

The error handling workflow is described here:
https://ez.robintail.cz/v25.5.2/error-handling

Express Zod API is not a middleware, because it does not call next() here:

.concat(async (request, response) => {
const logger = getLogger(request);
return endpoint.execute({ request, response, logger, config });

It is designed to handle errors by the ResultHandler attached to EndpointsFactory, so that negative responses would be consistent and match their depiction in the generated documentation.

When you throw from ResultHandler it ends up in lastResortHandler.

So, why won't…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by RobinTail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
unclear Is it a bug or a feature?
2 participants