summaryrefslogtreecommitdiff
path: root/doc/guides
diff options
context:
space:
mode:
authorVse Mozhet Byt <vsemozhetbyt@gmail.com>2017-06-20 17:14:17 +0300
committerJames M Snell <jasnell@gmail.com>2017-06-21 20:43:01 -0700
commit259466c6f4e01f547b1400dc7caf7df471d6f0aa (patch)
tree77fc64e450c9b4f45589bf398d0038c9e9053e50 /doc/guides
parent3e18c49657bcb0f2504def3d7d6d900f0c25e357 (diff)
downloadandroid-node-v8-259466c6f4e01f547b1400dc7caf7df471d6f0aa.tar.gz
android-node-v8-259466c6f4e01f547b1400dc7caf7df471d6f0aa.tar.bz2
android-node-v8-259466c6f4e01f547b1400dc7caf7df471d6f0aa.zip
doc: fix nits in guides/using-internal-errors.md
PR-URL: https://github.com/nodejs/node/pull/13820 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: David Cai <davidcai1993@yahoo.com>
Diffstat (limited to 'doc/guides')
-rw-r--r--doc/guides/using-internal-errors.md14
1 files changed, 7 insertions, 7 deletions
diff --git a/doc/guides/using-internal-errors.md b/doc/guides/using-internal-errors.md
index 16b8c90963..ea011aaa83 100644
--- a/doc/guides/using-internal-errors.md
+++ b/doc/guides/using-internal-errors.md
@@ -27,7 +27,7 @@ are intended to replace existing `Error` objects within the Node.js source.
For instance, an existing `Error` such as:
```js
- const err = new TypeError('Expected string received ' + type);
+const err = new TypeError(`Expected string received ${type}`);
```
Can be replaced by first adding a new error key into the `internal/errors.js`
@@ -40,9 +40,9 @@ E('FOO', 'Expected string received %s');
Then replacing the existing `new TypeError` in the code:
```js
- const errors = require('internal/errors');
- // ...
- const err = new errors.TypeError('FOO', type);
+const errors = require('internal/errors');
+// ...
+const err = new errors.TypeError('FOO', type);
```
## Adding new errors
@@ -90,7 +90,7 @@ The specific error message for the `myError` instance will depend on the
associated value of `KEY` (see "Adding new errors").
The `myError` object will have a `code` property equal to the `key` and a
-`name` property equal to `Error[${key}]`.
+`name` property equal to `` `Error [${key}]` ``.
### Class: errors.TypeError(key[, args...])
@@ -110,7 +110,7 @@ The specific error message for the `myError` instance will depend on the
associated value of `KEY` (see "Adding new errors").
The `myError` object will have a `code` property equal to the `key` and a
-`name` property equal to `TypeError[${key}]`.
+`name` property equal to `` `TypeError [${key}]` ``.
### Class: errors.RangeError(key[, args...])
@@ -130,7 +130,7 @@ The specific error message for the `myError` instance will depend on the
associated value of `KEY` (see "Adding new errors").
The `myError` object will have a `code` property equal to the `key` and a
-`name` property equal to `RangeError[${key}]`.
+`name` property equal to `` `RangeError [${key}]` ``.
### Method: errors.message(key, args)