fix: don't crash Utility Processes on unhandled rejections (#45921)
* fix: don't crash on unhandled rejections * Update docs/breaking-changes.md Co-authored-by: Niklas Wenzel <dev@nikwen.de> --------- Co-authored-by: Niklas Wenzel <dev@nikwen.de>
This commit is contained in:
parent
5817d27429
commit
c0e180758b
2 changed files with 16 additions and 0 deletions
|
@ -14,6 +14,19 @@ This document uses the following convention to categorize breaking changes:
|
|||
|
||||
## Planned Breaking API Changes (36.0)
|
||||
|
||||
### Utility Process unhandled rejection behavior change
|
||||
|
||||
Utility Processes will now warn with an error message when an unhandled
|
||||
rejection occurs instead of crashing the process.
|
||||
|
||||
To restore the previous behavior, you can use:
|
||||
|
||||
```js
|
||||
process.on('uncaughtException', () => {
|
||||
process.exit(1)
|
||||
})
|
||||
```
|
||||
|
||||
### Removed:`isDefault` and `status` properties on `PrinterInfo`
|
||||
|
||||
These properties have been removed from the PrinterInfo Object
|
||||
|
|
|
@ -155,6 +155,9 @@ void NodeService::Initialize(
|
|||
|
||||
node_env_->set_trace_sync_io(node_env_->options()->trace_sync_io);
|
||||
|
||||
// We do not want to crash the utility process on unhandled rejections.
|
||||
node_env_->options()->unhandled_rejections = "warn-with-error-code";
|
||||
|
||||
// Add Electron extended APIs.
|
||||
electron_bindings_->BindTo(node_env_->isolate(), node_env_->process_object());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue