Skip to content

Commit 59aaee4

Browse files
cjihrigtargos
authored andcommitted
doc: format try...catch consistently
PR-URL: #28481 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent ec9ba4b commit 59aaee4

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

doc/api/addons.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ it is compiled (i.e. sometimes it may be in `./build/Debug/`), Addons can use
311311
the [bindings][] package to load the compiled module.
312312

313313
While the `bindings` package implementation is more sophisticated in how it
314-
locates Addon modules, it is essentially using a try-catch pattern similar to:
314+
locates Addon modules, it is essentially using a `trycatch` pattern similar to:
315315

316316
```js
317317
try {

doc/api/errors.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,10 @@ try {
171171

172172
This will not work because the callback function passed to `fs.readFile()` is
173173
called asynchronously. By the time the callback has been called, the
174-
surrounding code, including the `try { } catch (err) { }` block, will have
175-
already exited. Throwing an error inside the callback **can crash the Node.js
176-
process** in most cases. If [domains][] are enabled, or a handler has been
177-
registered with `process.on('uncaughtException')`, such errors can be
178-
intercepted.
174+
surrounding code, including the `try…catch` block, will have already exited.
175+
Throwing an error inside the callback **can crash the Node.js process** in most
176+
cases. If [domains][] are enabled, or a handler has been registered with
177+
`process.on('uncaughtException')`, such errors can be intercepted.
179178

180179
## Class: Error
181180

doc/api/fs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fs.unlink('/tmp/hello', (err) => {
3232
```
3333

3434
Exceptions that occur using synchronous operations are thrown immediately and
35-
may be handled using `try`/`catch`, or may be allowed to bubble up.
35+
may be handled using `trycatch`, or may be allowed to bubble up.
3636

3737
```js
3838
const fs = require('fs');

0 commit comments

Comments
 (0)