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

Fixed handling of an exception within a class constructor #99

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

atvise
Copy link

@atvise atvise commented Oct 16, 2018

Added try catch within the class wrap_object function to catch possible exceptions from the ctor_ function

@atvise atvise force-pushed the fix_ctor_exception_handling branch 4 times, most recently from fcf0a29 to bcfeb2b Compare October 16, 2018 08:24
@atvise atvise force-pushed the fix_ctor_exception_handling branch from bcfeb2b to e68d34f Compare October 16, 2018 08:27
@pmed
Copy link
Owner

pmed commented Oct 17, 2018

Hi @atvise,

Thanks a lot for the your recent contributions! Excuse me, I really have no spare time to review and merge you pull-request at this time.

The Travis CI build could fail due to old V8 versions. So the pre-requisit will be release v8pp version 1.6 with minimum required V8 version 6.3. After that I think your pull-requests would be merged successfully.

@atvise
Copy link
Author

atvise commented Oct 17, 2018

Hi @pmed,

you'r welcome! No problem ;) If you have time again let me know!

pmed added a commit that referenced this pull request Oct 20, 2018
Idea suggested by pull-request #99
@pmed
Copy link
Owner

pmed commented Oct 20, 2018

Hi,

There is already exception handling in JS constructor function: https://github.com/pmed/v8pp/blob/master/v8pp/class.hpp#L69-L76 that translates std::exception into v8::Exception and returns it as the JS ctor function result.

I've added a couple of checks into the v8pp::class_ test case. These checks work as expected, handling both std::exception, and v8::Exception thrown from the create_X() construction function.

@pmed pmed force-pushed the master branch 2 times, most recently from b482a7c to 8ab2770 Compare July 21, 2019 18:01
@pmed pmed force-pushed the master branch 2 times, most recently from 14bc459 to 352c061 Compare March 14, 2021 14:46
@pmed pmed force-pushed the master branch 2 times, most recently from bd106c3 to 6611145 Compare November 2, 2021 22:44
@pmed pmed force-pushed the master branch 3 times, most recently from 4119f8e to 211ef9b Compare March 19, 2022 19:04
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

Successfully merging this pull request may close these issues.

2 participants