Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async function error stack trace #14

Open
sl-sudo opened this issue Jul 2, 2020 · 0 comments
Open

Async function error stack trace #14

sl-sudo opened this issue Jul 2, 2020 · 0 comments

Comments

@sl-sudo
Copy link

sl-sudo commented Jul 2, 2020

Hi, I'm using Elastic APM in our node projects and I found it lose stack trace when an async function throws an error. In the source code I found the error stack is first handled by stackman, and the frames will lose "From previous event" part. I found if frames length is 0, error will be handled by error-stack-parser, and the error stack can be parsed correctly.
So can the stckman also add this feature? Async functions are very commonly in node.js.
code like this:

const id = someAsyncFunction();
anotherFunction(id);

error like this:

nodejs.unhandledRejectionError: Invalid value Promise { <pending> }
    at Object.escape (/node_modules/sequelize/lib/sql-string.js:65:11)
    ......
    at processImmediate (internal/timers.js:439:21)
From previous event:
    at Function.findAll (/node_modules/sequelize/lib/model.js:1755:8)
    ......
name: "unhandledRejectionError"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant