Skip to content

Commit

Permalink
src: ignore termination exceptions in fatal TryCatch
Browse files Browse the repository at this point in the history
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 committed Dec 31, 2018
1 parent 4100001 commit a84e0ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node_errors.cc
Expand Up @@ -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);
Expand Down

0 comments on commit a84e0ec

Please sign in to comment.