From cce78bbdf5ca4e2fad2766978cb29a2ee9631647 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sun, 30 Jun 2019 11:42:52 -0400 Subject: [PATCH] doc: format try...catch consistently PR-URL: https://github.com/nodejs/node/pull/28481 Reviewed-By: Luigi Pinca Reviewed-By: Rich Trott Reviewed-By: Ruben Bridgewater Reviewed-By: Trivikram Kamat --- doc/api/addons.md | 2 +- doc/api/errors.md | 9 ++++----- doc/api/fs.md | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/doc/api/addons.md b/doc/api/addons.md index eb17650223a6a5..a75d287dce156a 100644 --- a/doc/api/addons.md +++ b/doc/api/addons.md @@ -311,7 +311,7 @@ it is compiled (i.e. sometimes it may be in `./build/Debug/`), Addons can use the [bindings][] package to load the compiled module. While the `bindings` package implementation is more sophisticated in how it -locates Addon modules, it is essentially using a try-catch pattern similar to: +locates Addon modules, it is essentially using a `try…catch` pattern similar to: ```js try { diff --git a/doc/api/errors.md b/doc/api/errors.md index 64cdb9eb57430d..6669623239b60d 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -171,11 +171,10 @@ try { This will not work because the callback function passed to `fs.readFile()` is called asynchronously. By the time the callback has been called, the -surrounding code, including the `try { } catch (err) { }` block, will have -already exited. Throwing an error inside the callback **can crash the Node.js -process** in most cases. If [domains][] are enabled, or a handler has been -registered with `process.on('uncaughtException')`, such errors can be -intercepted. +surrounding code, including the `try…catch` block, will have already exited. +Throwing an error inside the callback **can crash the Node.js process** in most +cases. If [domains][] are enabled, or a handler has been registered with +`process.on('uncaughtException')`, such errors can be intercepted. ## Class: Error diff --git a/doc/api/fs.md b/doc/api/fs.md index c6ae9a83ac4114..568e7447f06d22 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -32,7 +32,7 @@ fs.unlink('/tmp/hello', (err) => { ``` Exceptions that occur using synchronous operations are thrown immediately and -may be handled using `try`/`catch`, or may be allowed to bubble up. +may be handled using `try…catch`, or may be allowed to bubble up. ```js const fs = require('fs');