summaryrefslogtreecommitdiff
path: root/src/node_errors.cc
diff options
context:
space:
mode:
authorHarshitha KP <harshi46@in.ibm.com>2020-03-16 02:13:10 -0400
committerSam Roberts <vieuxtech@gmail.com>2020-03-25 12:43:45 -0700
commit2fa74e3e38bb028339e48763138456b3ed10ed97 (patch)
tree5290bc573103d0e6088c5ddcd5625d919f6ceb82 /src/node_errors.cc
parent388cef61e8a4859b7505f7b5cf988eba27ce17b4 (diff)
downloadnode-new-2fa74e3e38bb028339e48763138456b3ed10ed97.tar.gz
report: handle on-fatalerror better
--report-on-fatalerror was not honored properly, as there was no way to check the value which was stored in the Environment pointer which can be inaccessible under certain fatal error situations. Move the flag out of Environment pointer so that this is doable. Co-authored-by: Shobhit Chittora schittora@paypal.com PR-URL: https://github.com/nodejs/node/pull/32207 Fixes: https://github.com/nodejs/node/issues/31576 Refs: https://github.com/nodejs/node/pull/29881 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Diffstat (limited to 'src/node_errors.cc')
-rw-r--r--src/node_errors.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node_errors.cc b/src/node_errors.cc
index ae1da87ef6..590562cccf 100644
--- a/src/node_errors.cc
+++ b/src/node_errors.cc
@@ -406,7 +406,7 @@ void OnFatalError(const char* location, const char* message) {
Isolate* isolate = Isolate::GetCurrent();
Environment* env = Environment::GetCurrent(isolate);
- if (env == nullptr || env->isolate_data()->options()->report_on_fatalerror) {
+ if (per_process::cli_options->report_on_fatalerror) {
report::TriggerNodeReport(
isolate, env, message, "FatalError", "", Local<String>());
}