summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/api/report.md2
-rw-r--r--src/node_errors.cc2
-rw-r--r--src/node_report.cc24
-rw-r--r--src/node_report.h4
-rw-r--r--test/common/report.js4
5 files changed, 18 insertions, 18 deletions
diff --git a/doc/api/report.md b/doc/api/report.md
index 90173a1cfa..856cd80119 100644
--- a/doc/api/report.md
+++ b/doc/api/report.md
@@ -23,7 +23,7 @@ is provided below for reference.
{
"header": {
"event": "exception",
- "location": "OnUncaughtException",
+ "trigger": "Exception",
"filename": "report.20181221.005011.8974.001.json",
"dumpEventTime": "2018-12-21T00:50:11Z",
"dumpEventTimeStamp": "1545371411331",
diff --git a/src/node_errors.cc b/src/node_errors.cc
index 17394c863c..1c15b55584 100644
--- a/src/node_errors.cc
+++ b/src/node_errors.cc
@@ -318,7 +318,7 @@ void OnFatalError(const char* location, const char* message) {
Environment* env = Environment::GetCurrent(isolate);
if (env == nullptr || env->isolate_data()->options()->report_on_fatalerror) {
report::TriggerNodeReport(
- isolate, env, message, __func__, "", Local<String>());
+ isolate, env, message, "FatalError", "", Local<String>());
}
#endif // NODE_REPORT
fflush(stderr);
diff --git a/src/node_report.cc b/src/node_report.cc
index 4617fb6271..85c66a51bf 100644
--- a/src/node_report.cc
+++ b/src/node_report.cc
@@ -70,7 +70,7 @@ using v8::Value;
static void WriteNodeReport(Isolate* isolate,
Environment* env,
const char* message,
- const char* location,
+ const char* trigger,
const std::string& filename,
std::ostream& out,
Local<String> stackstr,
@@ -79,7 +79,7 @@ static void PrintVersionInformation(JSONWriter* writer);
static void PrintJavaScriptStack(JSONWriter* writer,
Isolate* isolate,
Local<String> stackstr,
- const char* location);
+ const char* trigger);
static void PrintNativeStack(JSONWriter* writer);
#ifndef _WIN32
static void PrintResourceUsage(JSONWriter* writer);
@@ -100,7 +100,7 @@ static std::atomic_int seq = {0}; // sequence number for report filenames
std::string TriggerNodeReport(Isolate* isolate,
Environment* env,
const char* message,
- const char* location,
+ const char* trigger,
std::string name,
Local<String> stackstr) {
std::ostringstream oss;
@@ -178,7 +178,7 @@ std::string TriggerNodeReport(Isolate* isolate,
<< "Writing Node.js report to file: " << filename << std::endl;
}
- WriteNodeReport(isolate, env, message, location, filename, *outstream,
+ WriteNodeReport(isolate, env, message, trigger, filename, *outstream,
stackstr, &tm_struct);
// Do not close stdout/stderr, only close files we opened.
@@ -194,14 +194,14 @@ std::string TriggerNodeReport(Isolate* isolate,
void GetNodeReport(Isolate* isolate,
Environment* env,
const char* message,
- const char* location,
+ const char* trigger,
Local<String> stackstr,
std::ostream& out) {
// Obtain the current time and the pid (platform dependent)
TIME_TYPE tm_struct;
LocalTime(&tm_struct);
WriteNodeReport(
- isolate, env, message, location, "", out, stackstr, &tm_struct);
+ isolate, env, message, trigger, "", out, stackstr, &tm_struct);
}
// Internal function to coordinate and write the various
@@ -209,7 +209,7 @@ void GetNodeReport(Isolate* isolate,
static void WriteNodeReport(Isolate* isolate,
Environment* env,
const char* message,
- const char* location,
+ const char* trigger,
const std::string& filename,
std::ostream& out,
Local<String> stackstr,
@@ -228,7 +228,7 @@ static void WriteNodeReport(Isolate* isolate,
writer.json_objectstart("header");
writer.json_keyvalue("event", message);
- writer.json_keyvalue("location", location);
+ writer.json_keyvalue("trigger", trigger);
if (!filename.empty())
writer.json_keyvalue("filename", filename);
else
@@ -280,7 +280,7 @@ static void WriteNodeReport(Isolate* isolate,
writer.json_objectend();
// Report summary JavaScript stack backtrace
- PrintJavaScriptStack(&writer, isolate, stackstr, location);
+ PrintJavaScriptStack(&writer, isolate, stackstr, trigger);
// Report native stack backtrace
PrintNativeStack(&writer);
@@ -372,12 +372,12 @@ static void PrintVersionInformation(JSONWriter* writer) {
static void PrintJavaScriptStack(JSONWriter* writer,
Isolate* isolate,
Local<String> stackstr,
- const char* location) {
+ const char* trigger) {
writer->json_objectstart("javascriptStack");
std::string ss;
- if ((!strcmp(location, "OnFatalError")) ||
- (!strcmp(location, "Signal"))) {
+ if ((!strcmp(trigger, "FatalError")) ||
+ (!strcmp(trigger, "Signal"))) {
ss = "No stack.\nUnavailable.\n";
} else {
String::Utf8Value sv(isolate, stackstr);
diff --git a/src/node_report.h b/src/node_report.h
index 2aa55151d8..7d36557e66 100644
--- a/src/node_report.h
+++ b/src/node_report.h
@@ -43,13 +43,13 @@ typedef struct tm TIME_TYPE;
std::string TriggerNodeReport(v8::Isolate* isolate,
node::Environment* env,
const char* message,
- const char* location,
+ const char* trigger,
std::string name,
v8::Local<v8::String> stackstr);
void GetNodeReport(v8::Isolate* isolate,
node::Environment* env,
const char* message,
- const char* location,
+ const char* trigger,
v8::Local<v8::String> stackstr,
std::ostream& out);
diff --git a/test/common/report.js b/test/common/report.js
index c544cd8678..5655602fe8 100644
--- a/test/common/report.js
+++ b/test/common/report.js
@@ -58,7 +58,7 @@ function _validateContent(data) {
// Verify the format of the header section.
const header = report.header;
- const headerFields = ['event', 'location', 'filename', 'dumpEventTime',
+ const headerFields = ['event', 'trigger', 'filename', 'dumpEventTime',
'dumpEventTimeStamp', 'processId', 'commandLine',
'nodejsVersion', 'wordSize', 'arch', 'platform',
'componentVersions', 'release', 'osName', 'osRelease',
@@ -66,7 +66,7 @@ function _validateContent(data) {
'glibcVersionCompiler'];
checkForUnknownFields(header, headerFields);
assert.strictEqual(typeof header.event, 'string');
- assert.strictEqual(typeof header.location, 'string');
+ assert.strictEqual(typeof header.trigger, 'string');
assert(typeof header.filename === 'string' || header.filename === null);
assert.notStrictEqual(new Date(header.dumpEventTime).toString(),
'Invalid Date');