Repository navigation
feat(v9/node): Capture SystemError context and remove paths from message - #17394
Merged
Merged
Conversation
AbhiPrasad
approved these changes
Aug 12, 2025
Contributor
size-limit report 📦
|
timfish
marked this pull request as ready for review
August 12, 2025 15:12
| } | ||
| if (error.dest && exception.value.includes(error.dest)) { | ||
| exception.value = exception.value.replace(`'${error.dest}'`, '').trim(); | ||
| } |
There was a problem hiding this comment.
Bug: Error Message Handling and Context Population Issues
The systemErrorIntegration has two distinct issues:
- The logic to remove
pathanddestfrom exception messages assumes they are wrapped in single quotes and usesreplace()which only removes the first occurrence. This fails if paths are unquoted, use different quotes, contain single quotes, or appear multiple times, potentially leaving malformed messages. - The
node_system_errorcontext is populated by spreading the entireErrorobject, including baseErrorproperties likename,message, andstack. This adds unnecessary data and can lead to unintended information leakage. Only SystemError-specific properties should be included.
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.
SystemErrorcontext and remove paths from message #17331