Skip to content

fix: internal function _addHook failure should be turned into the rejection app.ready is waiting for#6105

Merged
Eomm merged 4 commits intofastify:mainfrom
jean-michelet:fix/_add-hook-uncatchable
May 11, 2025
Merged

fix: internal function _addHook failure should be turned into the rejection app.ready is waiting for#6105
Eomm merged 4 commits intofastify:mainfrom
jean-michelet:fix/_add-hook-uncatchable

Conversation

@jean-michelet
Copy link
Copy Markdown
Member

Currently, we can't catch this:

fastify.addHook("invalidHook", () => {});

try {
  await fastify.ready()
} catch (error) {
  // Unreachable
}

@Eomm Eomm added the bugfix Issue or PR that should land as semver patch label May 11, 2025
@Eomm Eomm merged commit 8ddd4fa into fastify:main May 11, 2025
34 checks passed
jean-michelet added a commit to jean-michelet/fastify that referenced this pull request May 13, 2025
@jean-michelet jean-michelet deleted the fix/_add-hook-uncatchable branch May 26, 2025 18:48
@github-actions
Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bugfix Issue or PR that should land as semver patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants