evanw / evanw/node-source-map-support

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

Aperta
#337 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
2.2k
Fork
223
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

It truncates the error cause lines

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

### current behavior

![image](https://github.com/evanw/node-source-map-support/assets/13461315/94121e28-7c42-459f-b63e-821004ba7bdb)

### expected behavior

![image](https://github.com/evanw/node-source-map-support/assets/13461315/bb3ffd85-48b5-4c7a-a072-a5e500a3cf09)

note that it's truncating the last lines

#### version

- package: `0.5.21`
- nodejs: 22

---

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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.