GeezerVison is showing github.com — node-api: add deprecation code of uncaught exception · styfle/node@9b36982
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: doc/api/deprecations.md +22Lines changed: 22 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -3238,12 +3238,34 @@ details. |
3238 | 3238 | These groups might be removed in future versions of Node.js. Applications that |
3239 | 3239 | rely on these groups should evaluate using stronger MODP groups instead. |
3240 | 3240 |
|
| 3241 | +### DEP0168: Unhandled exception in Node-API callbacks |
| 3242 | + |
| 3243 | +<!-- YAML |
| 3244 | +changes: |
| 3245 | + - version: |
| 3246 | + - v18.3.0 |
| 3247 | + - v16.17.0 |
| 3248 | + pr-url: https://github.com/nodejs/node/pull/36510 |
| 3249 | + description: Runtime deprecation. |
| 3250 | +--> |
| 3251 | + |
| 3252 | +Type: Runtime. |
| 3253 | + |
| 3254 | +The implicit suppression of uncaught exceptions in Node-API callbacks is now |
| 3255 | +deprecated. |
| 3256 | + |
| 3257 | +Set the flag [`--force-node-api-uncaught-exceptions-policy`][] to force Node.js |
| 3258 | +to emit an [`'uncaughtException'`][] event if the exception is not handled in |
| 3259 | +Node-API callbacks. |
| 3260 | + |
3241 | 3261 | [Legacy URL API]: url.md#legacy-url-api |
3242 | 3262 | [NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf |
3243 | 3263 | [RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3 |
3244 | 3264 | [RFC 8247 Section 2.4]: https://www.rfc-editor.org/rfc/rfc8247#section-2.4 |
3245 | 3265 | [WHATWG URL API]: url.md#the-whatwg-url-api |
3246 | 3266 | [`"exports"` or `"main"` entry]: packages.md#main-entry-point-export |
| 3267 | +[`'uncaughtException'`]: process.md#event-uncaughtexception |
| 3268 | +[`--force-node-api-uncaught-exceptions-policy`]: cli.md#--force-node-api-uncaught-exceptions-policy |
3247 | 3269 | [`--pending-deprecation`]: cli.md#--pending-deprecation |
3248 | 3270 | [`--throw-deprecation`]: cli.md#--throw-deprecation |
3249 | 3271 | [`--trace-atomics-wait`]: cli.md#--trace-atomics-wait |
|
Collapse file
Copy file name to clipboardExpand all lines: src/node_api.cc +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -90,7 +90,7 @@ void node_napi_env__::CallbackIntoModule(T&& call) { |
90 | 90 | "Uncaught N-API callback exception detected, please run node " |
91 | 91 | "with option --force-node-api-uncaught-exceptions-policy=true" |
92 | 92 | "to handle those exceptions properly.", |
93 | | - "DEP0XXX"); |
| 93 | + "DEP0168"); |
94 | 94 | return; |
95 | 95 | } |
96 | 96 | // If there was an unhandled exception in the complete callback, |
|