forked from fastify/fastify
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(fastify#5220): better support encapsulated synchronous error hand…
…lers Parent error handling for synchronous error handlers was largely a unintended byproduct of some other try catches previously. This could result in a server crash if multiple error handlers were used, and rethrew errors (see fastify#5220). This PR fixes this behavior by retrying synchronous error handling (similar to how we already do in wrapThenable for asynchronous error handling). It also adds regression tests to ensure this continues to work properly.
- Loading branch information
Showing
2 changed files
with
104 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters