Sentry-javascript: Async stack traces in Node.js not surfaced (Error.stack)

Created on 29 Jan 2020  ·  2Comments  ·  Source: getsentry/sentry-javascript

Package + Version

  • [ ] @sentry/browser
  • [x] @sentry/node
  • [ ] raven-js
  • [ ] raven-node _(raven for node)_
  • [ ] other:

Version:

5.11.1

Node v12.14.1

Description

Create a test function

async function test(i) {
  console.log(i);
  if ( i < 10 ) {
    await test(i+1);
  } else {
    await new Promise( (resolve) => setTimeout( resolve, 1000 ));
    try {
      throw Error("Example bad error");
    } catch ( e ) {
      console.error(e.stack);
      Sentry.captureException(e);
    }
  }
}```

See stack trace:

Error: Example bad error
at test (dist/main.js:57:19)
at runNextTicks (internal/process/task_queues.js:59:5)
at processTimers (internal/timers.js:472:9)
at async test (dist/main.js:52:9)
at async test (dist/main.js:52:9)
at async test (dist/main.js:52:9)
at async test (dist/main.js:52:9)
at async test (dist/main.js:52:9)
at async test (dist/main.js:52:9)
at async test (dist/main.js:52:9)
```

Stack trace in Sentry is missing async lines.

Needs Triage

Most helpful comment

Hi @mjgp2

Can you please share why this issue was closed?

Cheers

All 2 comments

Hi @mjgp2

Can you please share why this issue was closed?

Cheers

@steelbrain we support async stacktraces just fine

Was this page helpful?
0 / 5 - 0 ratings