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 authored and targos committed Jan 1, 2019
1 parent c9d49d6 commit ae86192
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node_errors.cc
Original file line number Diff line number Diff line change
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 ae86192

Please sign in to comment.