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:
Shelley Vohr 2025-03-14 15:09:02 +01:00 committed by GitHub
parent 5817d27429
commit c0e180758b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 0 deletions

View file

@ -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());