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

Bad stack trace for error #7

Open
anorsich opened this issue Apr 29, 2019 · 2 comments
Open

Bad stack trace for error #7

anorsich opened this issue Apr 29, 2019 · 2 comments

Comments

@anorsich
Copy link
Contributor

With node-mongo we usually get not very helpful stack trace, like this one:

 level:  "error"   
  message:  "MongoServiceError: Document not found while updating. Query: {"_id":"5cc4a6f9361f3f0012151b4c"}
    at MongoService.update (/app/node_modules/@auxilin/node-mongo/src/MongoService.js:123:13)
    at process._tickCallback (internal/process/next_tick.js:68:7)"   
  timestamp:  "2019-04-29T06:38:49.924Z"   

How do we improve it to show where this error has happened?

@ezhivitsa
Copy link
Contributor

@anorsich As far as I understand the problem has appeared because Node.js can't capture stack trace inside an asynchronous function. But in Node 12 there is a flag --async-stack-traces in order to resolve the problem. But this flag should be used in the application itself.

@anorsich
Copy link
Contributor Author

We'll have to wait until 2019-10-22 for Node 12 to become LTS release, but this is certainly better than nothing :) @ezhivitsa

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

2 participants