diff --git a/docs/breaking-changes.md b/docs/breaking-changes.md index f09a7a3f3d7c..45dcfdb37ada 100644 --- a/docs/breaking-changes.md +++ b/docs/breaking-changes.md @@ -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 diff --git a/shell/services/node/node_service.cc b/shell/services/node/node_service.cc index 52a7a7e7bca1..c7a0140e39c9 100644 --- a/shell/services/node/node_service.cc +++ b/shell/services/node/node_service.cc @@ -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());