-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
vm: behavior with --abort-on-uncaught-exception #13258
Comments
I agree, this looks like a bug.
I’m not sure – why doesn’t V8 see the |
My understanding of the code I linked (and I could definitely be wrong) is that the |
/cc @nodejs/v8 |
I'd say this is a bug but I don't have a good suggestion off the top of my head on how to fix it.
|
Even if we can't fix this in the general case, do you think it's worth adding an option to the |
As this is very brittle to changes, I'd prefer not to add the option. As Ben said, most solutions would break more than fix. Do you have a use case for it? Would it be enough to note the bug in the documentation? |
I'm definitely in favor of at least documenting this. I don't personally have a need for the option. However, running with |
Keep track of C++ `TryCatch` state to avoid aborting when an exception is thrown inside one, and re-throw in JS to make sure the exception is being picked up a second time by a second uncaught exception handler, if necessary. Add a bit of a hack to `AppendExceptionLine` to avoid overriding the line responsible for re-throwing the exception. Fixes: nodejs#13258
Keep track of C++ `TryCatch` state to avoid aborting when an exception is thrown inside one, and re-throw in JS to make sure the exception is being picked up a second time by a second uncaught exception handler, if necessary. Add a bit of a hack to `AppendExceptionLine` to avoid overriding the line responsible for re-throwing the exception. PR-URL: #17394 Fixes: #13258 Reviewed-By: James M Snell <[email protected]>
In the following code, the
vm.Script()
constructor throws an exception. When node is run normally, the exception is caught and node exits cleanly. However, when run with--abort-on-uncaught-exception
, the exception is treated as uncaught.Before attempting to fix this, I wanted to make sure there is agreement that this is a bug. This seems like something that could be handled in
ShouldAbortOnUncaughtException()
.Related: nodejs/node-report#60
The text was updated successfully, but these errors were encountered: