Skip to content

Commit c91ddf2

Browse files
fix: don't crash Web Workers on unhandled rejections (#46020)
Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <[email protected]>
1 parent 02783dd commit c91ddf2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

shell/renderer/web_worker_observer.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ void WebWorkerObserver::WorkerScriptReadyForEvaluation(
8585
}
8686
}
8787

88+
// We do not want to crash Web Workers on unhandled rejections.
89+
env->options()->unhandled_rejections = "warn-with-error-code";
90+
8891
// Add Electron extended APIs.
8992
electron_bindings_->BindTo(env->isolate(), env->process_object());
9093

0 commit comments

Comments
 (0)