node-addon-api
node-addon-api copied to clipboard
feat: allow catching all exceptions
Adds new compile-time define (NAPI_CPP_EXCEPTIONS_ALL) to enable catching all exceptions.
Must be under a flag to be semver minor.
TODO:
- [ ] docs
- [ ] tests
Fixes: #1555
I'd like to discuss the naming of the new define NAPI_CPP_EXCEPTIONS_ALL ... to go with convention it should be NODE_ADDON_API_CPP_EXCEPTIONS_ALL.
We can use NODE_ADDON_API_CPP_EXCEPTIONS_ALL and introduce NODE_ADDON_API_CPP_EXCEPTIONS as a (backwards-compatible) replacement for NAPI_CPP_EXCEPTIONS_ALL ?
We discuss in the 18 Oct Node-API meeting:
- Use the
NODE_ADDON_API_prefix on the defines - Should the "catch all" be the new default?
- What about some best practices doc? We also mentioned this with the requiring basic finalizers option
Codecov Report
Attention: Patch coverage is 85.00000% with 6 lines in your changes missing coverage. Please review.
Project coverage is 66.29%. Comparing base (
98aae33) to head (df4e6b1). Report is 28 commits behind head on main.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| napi-inl.h | 85.00% | 1 Missing and 5 partials :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## main #1593 +/- ##
==========================================
- Coverage 66.35% 66.29% -0.07%
==========================================
Files 3 3
Lines 2143 2154 +11
Branches 703 708 +5
==========================================
+ Hits 1422 1428 +6
Misses 150 150
- Partials 571 576 +5
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Hi @vmoroz @mhdawson @legendecas @gabrielschulhof , I believe this is ready.