Skip to content

Commit 5e2cd3c

Browse files
committed
Add stack trace to unhandled rejection
1 parent b784b3e commit 5e2cd3c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

vscode-client/src/server.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ connection.listen()
2020

2121
// Don't die on unhandled Promise rejections
2222
process.on('unhandledRejection', (reason, p) => {
23-
connection.console.error(`Unhandled Rejection at promise: ${p}, reason: ${reason}`)
23+
const stack = reason instanceof Error ? reason.stack : reason
24+
connection.console.error(`Unhandled Rejection at promise: ${p}, reason: ${stack}`)
2425
})
2526

2627
process.on('SIGPIPE', () => {

0 commit comments

Comments
 (0)