Skip to content

Commit ae86192

Browse files
addaleaxtargos
authored andcommitted
src: ignore termination exceptions in fatal TryCatch
We don’t want these to terminate the process in case of Worker threads receiving a termination exception, rather than a “real one”. PR-URL: #25141 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
1 parent c9d49d6 commit ae86192

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/node_errors.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ void OnFatalError(const char* location, const char* message) {
315315
namespace errors {
316316

317317
TryCatchScope::~TryCatchScope() {
318-
if (HasCaught() && mode_ == CatchMode::kFatal) {
318+
if (HasCaught() && !HasTerminated() && mode_ == CatchMode::kFatal) {
319319
HandleScope scope(env_->isolate());
320320
ReportException(env_, Exception(), Message());
321321
exit(7);

0 commit comments

Comments
 (0)