From ae86192732df67a0b1df662bb7c2a5fce7064c0d Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 19 Dec 2018 23:07:53 +0100 Subject: [PATCH] src: ignore termination exceptions in fatal TryCatch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: https://github.com/nodejs/node/pull/25141 Reviewed-By: Joyee Cheung Reviewed-By: James M Snell Reviewed-By: Gus Caplan --- src/node_errors.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_errors.cc b/src/node_errors.cc index b7f7f59e70ef62..7775e36b69bc82 100644 --- a/src/node_errors.cc +++ b/src/node_errors.cc @@ -315,7 +315,7 @@ void OnFatalError(const char* location, const char* message) { namespace errors { TryCatchScope::~TryCatchScope() { - if (HasCaught() && mode_ == CatchMode::kFatal) { + if (HasCaught() && !HasTerminated() && mode_ == CatchMode::kFatal) { HandleScope scope(env_->isolate()); ReportException(env_, Exception(), Message()); exit(7);