| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,6 +22,7 @@ is provided below for reference. | |||
| 22 | 22 | ```json | |
| 23 | 23 | { | |
| 24 | 24 | "header": { | |
| 25 | + "reportVersion": 1, | ||
| 25 | 26 | "event": "exception", | |
| 26 | 27 | "trigger": "Exception", | |
| 27 | 28 | "filename": "report.20181221.005011.8974.0.001.json", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,6 +24,7 @@ | |||
| 24 | 24 | extern char** environ; | |
| 25 | 25 | #endif | |
| 26 | 26 | ||
| 27 | + constexpr int NODE_REPORT_VERSION = 1; | ||
| 27 | 28 | constexpr int NANOS_PER_SEC = 1000 * 1000 * 1000; | |
| 28 | 29 | constexpr double SEC_PER_MICROS = 1e-6; | |
| 29 | 30 | ||
@@ -172,7 +173,7 @@ static void WriteNodeReport(Isolate* isolate, | |||
| 172 | 173 | JSONWriter writer(out); | |
| 173 | 174 | writer.json_start(); | |
| 174 | 175 | writer.json_objectstart("header"); | |
| 175 | - | ||
| 176 | + writer.json_keyvalue("reportVersion", NODE_REPORT_VERSION); | ||
| 176 | 177 | writer.json_keyvalue("event", message); | |
| 177 | 178 | writer.json_keyvalue("trigger", trigger); | |
| 178 | 179 | if (!filename.empty()) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -63,8 +63,10 @@ function _validateContent(data) { | |||
| 63 | 63 | 'nodejsVersion', 'wordSize', 'arch', 'platform', | |
| 64 | 64 | 'componentVersions', 'release', 'osName', 'osRelease', | |
| 65 | 65 | 'osVersion', 'osMachine', 'cpus', 'host', | |
| 66 | - 'glibcVersionRuntime', 'glibcVersionCompiler', 'cwd']; | ||
| 66 | + 'glibcVersionRuntime', 'glibcVersionCompiler', 'cwd', | ||
| 67 | + 'reportVersion']; | ||
| 67 | 68 | checkForUnknownFields(header, headerFields); | |
| 69 | + assert.strictEqual(header.reportVersion, 1); // Increment as needed. | ||
| 68 | 70 | assert.strictEqual(typeof header.event, 'string'); | |
| 69 | 71 | assert.strictEqual(typeof header.trigger, 'string'); | |
| 70 | 72 | assert(typeof header.filename === 'string' || header.filename === null); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments