fix: include hint and docs URL in FSTWRN004 warning message#6723
Merged
jean-michelet merged 2 commits intoMay 30, 2026
Conversation
ffd699f to
eb39da4
Compare
eb39da4 to
b5e5c37
Compare
6ca1dd4 to
09f2e48
Compare
metcoder95
approved these changes
May 19, 2026
jean-michelet
requested changes
May 19, 2026
35a3cef to
cb36f93
Compare
cb36f93 to
a949c00
Compare
2 tasks
jean-michelet
approved these changes
May 20, 2026
Contributor
Author
|
@jean-michelet ready to merge whenever you are 🙏 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
FSTWRN004warning was created inlib/warnings.jswith a staticmessage that contained no
%sformat placeholder. As a result, thehint string passed at the call site in
fastify.jswas silently droppedby
process-warning, and users who triggered the warning never saw theactionable information about
allowErrorHandlerOverride.Root Cause
process-warning'screateWarningonly interpolates arguments when themessage contains
%splaceholders. With no placeholder present, anyargument passed to the emitter function is a no-op.
Changes
lib/warnings.js: Embed the hint and docs URL directly into thestatic message of
FSTWRN004.fastify.js: Remove the now-unused string argument from theFSTWRN004()call.test/set-error-handler.test.js: Add a test that asserts thewarning is emitted with
name,code, and the docs URL in themessage when
setErrorHandleris called more than once in the samescope.
Checklist
npm run test && npm run benchmark --if-presentand the Code of conduct