diff options
author | Chengzhong Wu <chengzhong.wcz@alibaba-inc.com> | 2022-08-24 20:02:26 +0300 |
---|---|---|
committer | Juan José Arboleda <soyjuanarbol@gmail.com> | 2022-10-11 22:45:21 +0300 |
commit | 381e11e18e20e7d10ce29c019df28573cc4594fc (patch) | |
tree | ca1bc3e44edf979c234ab029e848734c3f054d75 /src/node_errors.cc | |
parent | b53ea08d7b07a5b8a84d8e9da2d199dfa253a65b (diff) |
report: expose report public native apis
Allows APM vendors to generate a diagnostic report without calling into
JavaScript. Like, from their own message channels interrupting the
isolate and generating a report on demand.
PR-URL: https://github.com/nodejs/node/pull/44255
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Diffstat (limited to 'src/node_errors.cc')
-rw-r--r-- | src/node_errors.cc | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/node_errors.cc b/src/node_errors.cc index b464a37e378..bfc93ec70d2 100644 --- a/src/node_errors.cc +++ b/src/node_errors.cc @@ -411,8 +411,7 @@ static void ReportFatalException(Environment* env, } if (env->isolate_data()->options()->report_uncaught_exception) { - report::TriggerNodeReport( - isolate, env, report_message.c_str(), "Exception", "", error); + TriggerNodeReport(env, report_message.c_str(), "Exception", "", error); } if (env->options()->trace_uncaught) { @@ -440,10 +439,6 @@ void OnFatalError(const char* location, const char* message) { } Isolate* isolate = Isolate::TryGetCurrent(); - Environment* env = nullptr; - if (isolate != nullptr) { - env = Environment::GetCurrent(isolate); - } bool report_on_fatalerror; { Mutex::ScopedLock lock(node::per_process::cli_options_mutex); @@ -451,8 +446,7 @@ void OnFatalError(const char* location, const char* message) { } if (report_on_fatalerror) { - report::TriggerNodeReport( - isolate, env, message, "FatalError", "", Local<Object>()); + TriggerNodeReport(isolate, message, "FatalError", "", Local<Object>()); } fflush(stderr); @@ -470,10 +464,6 @@ void OOMErrorHandler(const char* location, bool is_heap_oom) { } Isolate* isolate = Isolate::TryGetCurrent(); - Environment* env = nullptr; - if (isolate != nullptr) { - env = Environment::GetCurrent(isolate); - } bool report_on_fatalerror; { Mutex::ScopedLock lock(node::per_process::cli_options_mutex); @@ -481,8 +471,7 @@ void OOMErrorHandler(const char* location, bool is_heap_oom) { } if (report_on_fatalerror) { - report::TriggerNodeReport( - isolate, env, message, "OOMError", "", Local<Object>()); + TriggerNodeReport(isolate, message, "OOMError", "", Local<Object>()); } fflush(stderr); |