From 7fa7a7feca534a87afb85272e5cc9d0275f9266a Mon Sep 17 00:00:00 2001 From: Michael Hart Date: Mon, 20 Oct 2025 21:53:18 +1100 Subject: [PATCH] Reset uncaught exception handling after startup execution Fixes #5332 --- src/workerd/io/worker.c++ | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/workerd/io/worker.c++ b/src/workerd/io/worker.c++ index 5519855b5b1..521c254ea2d 100644 --- a/src/workerd/io/worker.c++ +++ b/src/workerd/io/worker.c++ @@ -1832,6 +1832,12 @@ Worker::Worker(kj::Own scriptParam, impl->permanentException); } }); + + // Reset this back to its default after startup execution + // Leaving it on comes at the expense of collecting stack traces for all thrown exceptions + if (script->isolate->impl->inspector == kj::none) { + lock.v8Isolate->SetCaptureStackTraceForUncaughtExceptions(false); + } }); }); }