diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2019-03-18 15:41:19 +0100 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2019-03-21 22:52:08 +0100 |
commit | 39f4158bc38ff2925b86563082c8d26ab3d20b17 (patch) | |
tree | 9e1a669fd41379bcd9b85bdf0e17fde5033a2c77 /test | |
parent | df0870dddf15ab5396ab9842fdbe4c06a8186cda (diff) | |
download | android-node-v8-39f4158bc38ff2925b86563082c8d26ab3d20b17.tar.gz android-node-v8-39f4158bc38ff2925b86563082c8d26ab3d20b17.tar.bz2 android-node-v8-39f4158bc38ff2925b86563082c8d26ab3d20b17.zip |
lib: move extra properties into error creation
This encapsulates the Node.js errors more by adding extra properties
to an error inside of the function to create the error message instead
of adding the properties at the call site. That simplifies the usage
of our errors and makes sure the expected properties are always set.
PR-URL: https://github.com/nodejs/node/pull/26752
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-net-options-lookup.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/test/parallel/test-net-options-lookup.js b/test/parallel/test-net-options-lookup.js index 007be66f45..5661aee841 100644 --- a/test/parallel/test-net-options-lookup.js +++ b/test/parallel/test-net-options-lookup.js @@ -38,5 +38,10 @@ function connectDoesNotThrow(input) { cb(null, '127.0.0.1', 100); }); - s.on('error', common.expectsError({ code: 'ERR_INVALID_ADDRESS_FAMILY' })); + s.on('error', common.expectsError({ + code: 'ERR_INVALID_ADDRESS_FAMILY', + host: 'localhost', + port: 0, + message: 'Invalid address family: 100 localhost:0' + })); } |