Skip to content

Commit 0ae30a1

Browse files
committed
Adding diag report
1 parent b017ae5 commit 0ae30a1

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

diagnostics/index.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,20 @@ Find more information on [debugging using ndb](https://github.com/GoogleChromeLa
196196

197197
## Generating diagnostic reports
198198

199-
Sometimes we need more information to work out what is going on. To help with this, we can make use of Node's built-in `diagnostic report` feature:
199+
Sometimes we need more information to work out what is going on. To help with this, we can make use of Node's built-in [diagnostic report](https://nodejs.org/api/report.html) feature.
200200

201-
https://nodejs.org/dist/latest-v11.x/docs/api/report.html
201+
To create the report, we can run the following command against out `count.js` file above:
202202

203-
> With the report option enabled, diagnostic reports can be triggered on unhandled exceptions, fatal errors and user signals, in addition to triggering programmatically through API calls.
203+
```
204+
node --report-uncaught-exception count.js
205+
```
206+
207+
This generates [a report in JSON](/diagnostics/report.20210505.160745.11097.0.001.json) that you can read to try to work out what has happened.
208+
209+
210+
211+
212+
With the report option enabled, diagnostic reports can be triggered on unhandled exceptions, fatal errors and user signals, in addition to triggering programmatically through API calls. Read more on the official [diagnostic report docs page](https://nodejs.org/api/report.html).
204213

205214

206215
## Async hooks

0 commit comments

Comments
 (0)