-
Notifications
You must be signed in to change notification settings - Fork 15
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
add try/catch to HandleOKCallback #81
Conversation
@springmeyer any idea why codecov is still trying to cover after the comments? This commit tried to exclude the comments from coverage: 3ebc344 |
👍 Looks good to me! |
Thanks @GretaCB! 🙇 |
set_property(prop, properties_obj); | ||
} | ||
try { | ||
Nan::HandleScope scope; |
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.
@mapsam - the HandleScope needs to be outside of the try/catch. Otherwise it will not be able to function to clean up V8 objects in the catch
case.
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.
good catch @springmeyer - #84
This resolves #69 by adding a try/catch to the callback handler. I'm not 💯 sure how to generate a unit test for this, but confirmed it works locally by adding a
throw std::invalid_argument( "this is an error" );
within the try statement, and seeing the error respond as expected in a unit test.@flippmoke any ideas how to get coverage here? Or should I presume coverage isn't possible in this case?