fix: handle DOMException in Boom constructor - #307
Open
jpage-godaddy wants to merge 1 commit into
Open
Conversation
DOMException instances have getters that require correct 'this' context. Hoek.clone() creates copies that lose the internal structure needed for these getters to work, causing "Value of 'this' must be of DOMException" errors. Extract message and name properties before cloning to avoid this issue.
Marsup
added a commit
that referenced
this pull request
Aug 2, 2026
Marsup
added a commit
that referenced
this pull request
Aug 2, 2026
* chore: change CI target for next * chore: add next branch to CI targets * chore: bump lab * Rework to be a regular class instance * Tighten input types and make cause option explicit * Remove decorate option * Allow to boomify non-Error errors * Make _apply internal * Make isBoom a prototype property * Make isServer property computed * Refactor output and payload to classes * Remove unauthorized payload.attributes * Fix WWW-Authenticate header when empty attributes * Refactor implementation to use helpers * Add and use a Boom "headers" option * Use statusError for all helpers * Throw TypeError instead of Hoek assertion * Remove typeof property * Fix legacy boom object support * Add tests for "name" property * Explicit cause in super() call Co-authored-by: Matthieu Sieben <matthieusieben@users.noreply.github.com> * Assign .cause if not handled by super() call * Fix and update typings * Clone incoming headers * Cleanup typings * Narrow typings Co-authored-by: Matthieu Sieben <matthieusieben@users.noreply.github.com> * Revert "Remove decorate option" This reverts commit 19e5e2a. # Conflicts: # lib/index.js * Use decorate option internally * Allow usage on runtimes with no Error.captureStackTrace() * Update docs * Restore decorate option to typings * Make reformat() apply to initial payload * Update typescript * Fix tests on windows filesystem * Don't set cause when not in the options * Allow isServer to be written to * Fix boomify option typings * Improve boomify typings * Document headers option * Require data option when Data generic is not unknown * Remove decorate option * Improve boomify data type support * Improve docs * Fix notImplemented and more setting Error cause * Cleanup * Ignore all non-object headers option * Shallow copy headers and throw when bad * Directly require escapeHeaderAttribute * chore: convert module to ESM * chore: add regression tests based on #307 --------- Co-authored-by: Gil Pedersen <git@gpost.dk> Co-authored-by: Gil Pedersen <github@gpost.dk> Co-authored-by: Matthieu Sieben <matthieusieben@users.noreply.github.com>
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.
DOMException instances have getters that require correct 'this' context. Hoek.clone() creates copies that lose the internal structure needed for these getters to work, causing "Value of 'this' must be of DOMException" errors. Extract message and name properties before cloning to avoid this issue.
Example stack trace error we were getting: