Skip to content
Permalink
Browse files

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>
  • Loading branch information...
addaleax authored and targos committed Dec 19, 2018
1 parent c9d49d6 commit ae86192732df67a0b1df662bb7c2a5fce7064c0d
Showing with 1 addition and 1 deletion.
  1. +1 −1 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);

0 comments on commit ae86192

Please sign in to comment.
You can’t perform that action at this time.