-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Labels
bugConfirmed bugConfirmed bug
Description
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the bug has not already been reported
Fastify version
5.4.0
Plugin version
No response
Node.js version
22.11.0
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
15.5
Description
Errors thrown from a custom validator while using an async preValidation hook are not caught by the error handler. Instead the error is unhandled and propagated to the Node runtime which kills the app. Removing the hook all together or using a synchronous approach (with done()) resolves the issue.
This issue seems similar to #2707
Link to code that reproduces the bug
https://github.com/jakedipity/scratchspace/tree/main/fastify-bug
Expected Behavior
Error handler should be called (we should see a setErrorHandler <Error> logged), the client is given a response, and the instance continues running. Instead the handler is not called, the connection socket hangs up, and the instance crashes.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugConfirmed bugConfirmed bug