Skip to content

Commit

Permalink
doc: fix nits in guides/using-internal-errors.md
Browse files Browse the repository at this point in the history
PR-URL: #13820
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: David Cai <[email protected]>
  • Loading branch information
vsemozhetbyt authored and jasnell committed Jun 22, 2017
1 parent 3e18c49 commit 259466c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions doc/guides/using-internal-errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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
Expand Down Expand Up @@ -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...])

Expand All @@ -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...])

Expand All @@ -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)

Expand Down

0 comments on commit 259466c

Please sign in to comment.