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: https://github.com/nodejs/node/pull/25141
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
This commit is contained in:
Anna Henningsen 2018-12-19 23:07:53 +01:00
parent 4100001624
commit a84e0ec0dd
No known key found for this signature in database
GPG Key ID: 9C63F3A6CD2AD8F9

View File

@ -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);