split err.stack so embedded stacks in err message render once#5997
Open
mostafaNazari702 wants to merge 1 commit into
Open
split err.stack so embedded stacks in err message render once#5997mostafaNazari702 wants to merge 1 commit into
mostafaNazari702 wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5997 +/- ##
==========================================
+ Coverage 82.64% 82.73% +0.08%
==========================================
Files 62 62
Lines 4668 4691 +23
Branches 1003 1042 +39
==========================================
+ Hits 3858 3881 +23
Misses 810 810 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
JoshuaKGoldberg
requested changes
Jun 7, 2026
mostafaNazari702
force-pushed
the
duplicate-stack-message
branch
from
June 19, 2026 13:17
9ad464b to
d385854
Compare
mostafaNazari702
force-pushed
the
duplicate-stack-message
branch
from
July 19, 2026 18:12
d385854 to
462e353
Compare
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.
PR Checklist
status: accepting prsOverview
getFullErrorStack used to split err.stack by searching for err.message in it. that breaks when mocha filters stack traces and rewrites file paths, message stays unchanged but the stack changes so indexOf fails and the error gets printed twice (message + full stack).
What we do now is instead of matching the message string we now parse the stack the V8 way: treat the trailing "at ......." lines as the stack frames and everything above as the message. If the stack doesn't match V8 format we fall back to the old behavior.
We also keep err.inspect() overrides and err.cause chaining working as before.