evanw / node-source-map-support

Adds source map support to node.js (for stack traces)
MIT License
2.16k stars 222 forks source link

feature request: do not truncate the 'cause' value on errors #337

Open micalevisk opened 1 week ago

micalevisk commented 1 week ago

It truncates the error cause lines

// app.js
require('source-map-support').install();
throw new Error('test 123', { cause: new Error('foo') })

current behavior

image

expected behavior

image

note that it's truncating the last lines

version


that's because the line bellow won't display the cause as it doesn't belongs to the stack trace:

https://github.com/evanw/node-source-map-support/blob/7b5b81eb14c9ee6c6537398262bf7dab8580621c/source-map-support.js#L499