-
Notifications
You must be signed in to change notification settings - Fork 9
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
fix(NODE-6348): Wrap thrown errors in JS Error objects with stacks #25
Conversation
I don't have a cargo setup on my machine at the moment but crossing my fingers the test passes in CI. :) |
Hi @sophiebits! 👋 CI's pointing out a syntax error in the test, let us know if you'd prefer to take care of that yourself or we should be pushing a fix this branch 🙂 |
We noticed in our usage of this package that thrown errors (eg: "Unknown frame descriptor") don't have a useful .stack property. This makes debugging harder. It seems this is expected behavior for errors created via napi at least on V8; it seems that the best way to remedy this is to recreate Error objects on the JS side?
Sloppy of me! Hope this will fix it. ^ |
Co-authored-by: Durran Jordan <durran@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(sorry about the messy tests)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the contribution. I'll have the rest of the team look as well.
Updated the bindings.js to the old index.js per discussion on internal Slack with respect to some operating systems we don't support (like Android). I've pushed that change to this PR. |
We noticed in our usage of this package that thrown errors (eg: "Unknown frame descriptor") don't have a useful .stack property. This makes debugging harder. It seems this is expected behavior for errors created via napi at least on V8; it seems that the best way to remedy this is to recreate Error objects on the JS side?
What is changing?
Is there new documentation needed for these changes?
What is the motivation for this change?
Double check the following
npm run format:js && npm run format:rs
scripttype(NODE-xxxx)[!]: description
feat(NODE-1234)!: rewriting everything in coffeescript