@@ -27,7 +27,7 @@ are intended to replace existing `Error` objects within the Node.js source.
2727For instance, an existing ` Error ` such as:
2828
2929``` js
30- const err = new TypeError (' Expected string received ' + type);
30+ const err = new TypeError (` Expected string received ${ type} ` );
3131```
3232
3333Can be replaced by first adding a new error key into the ` internal/errors.js `
@@ -40,9 +40,9 @@ E('FOO', 'Expected string received %s');
4040Then replacing the existing ` new TypeError ` in the code:
4141
4242``` js
43- const errors = require (' internal/errors' );
44- // ...
45- const err = new errors.TypeError (' FOO' , type);
43+ const errors = require (' internal/errors' );
44+ // ...
45+ const err = new errors.TypeError (' FOO' , type);
4646```
4747
4848## Adding new errors
@@ -90,7 +90,7 @@ The specific error message for the `myError` instance will depend on the
9090associated value of ` KEY ` (see "Adding new errors").
9191
9292The ` myError ` object will have a ` code ` property equal to the ` key ` and a
93- ` name ` property equal to ` Error[${key}] ` .
93+ ` name ` property equal to `` ` Error [${key}]` ` ` .
9494
9595### Class: errors.TypeError(key[ , args...] )
9696
@@ -110,7 +110,7 @@ The specific error message for the `myError` instance will depend on the
110110associated value of ` KEY ` (see "Adding new errors").
111111
112112The ` myError ` object will have a ` code ` property equal to the ` key ` and a
113- ` name ` property equal to ` TypeError[${key}] ` .
113+ ` name ` property equal to `` ` TypeError [${key}]` ` ` .
114114
115115### Class: errors.RangeError(key[ , args...] )
116116
@@ -130,7 +130,7 @@ The specific error message for the `myError` instance will depend on the
130130associated value of ` KEY ` (see "Adding new errors").
131131
132132The ` myError ` object will have a ` code ` property equal to the ` key ` and a
133- ` name ` property equal to ` RangeError[${key}] ` .
133+ ` name ` property equal to `` ` RangeError [${key}]` ` ` .
134134
135135### Method: errors.message(key, args)
136136
0 commit comments