node
node copied to clipboard
module: fix error reporting
Refs: #55350 Fixes: #55350
The error is incorrectly reported because the traceSync
call is on the stack frame. The code that computes the message was getting the first frame expecting it to have the information needed. Something like
at Object.<anonymous> (/Users/edysilva/test-node/issue-55350/test.cjs:1:1)
With traceSync
it's like
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at Object.<anonymous> (/Users/edysilva/test-node/issue-55350/test.cjs:1:1)
This PR fixes this behavior by skipping cutting frames about the user's frame.