8000 fix: handle c++ exception in TSFN callback by legendecas · Pull Request #1345 · nodejs/node-addon-api · GitHub
[go: up one dir, main page]

Skip to content

Conversation

legendecas
Copy link
Member

Rethrow Napi::Error exceptions as node-api exceptions at the boundary of TSFN callback.

Fixes: #1119

Copy link
Member
@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -0,0 +1,55 @@
'use strict';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: For the tests, you could use common.runTestInChildProcess(). You need to extend it to also accept Node.js command line arguments, but I think it might make the code a little cleaner.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, thanks for the suggestion! It's definitely an improvement after #1325 landed.

Copy link
Contributor
@KevinEady KevinEady left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

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.

ThreadSafeFunction should handle exceptions in async callbacks identical to Node itself

4 participants

0