Skip to content

Commit 9f257f3

Browse files
Anna Henningsenrefack
Anna Henningsen
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: nodejs#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 56e4180 commit 9f257f3

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)