diff options
author | matzavinos <matzavinos@workable.com> | 2017-08-12 00:02:15 +0300 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2017-10-15 11:48:38 +0800 |
commit | 7f55349079705a9e1d43024ed45c1351907f3d8e (patch) | |
tree | fc3d93337c8158a50a9aed188497c099b8f3266e /test/parallel/test-internal-errors.js | |
parent | 2b76b5d8dd14b57eaad15b4082cc007296b4d630 (diff) | |
download | android-node-v8-7f55349079705a9e1d43024ed45c1351907f3d8e.tar.gz android-node-v8-7f55349079705a9e1d43024ed45c1351907f3d8e.tar.bz2 android-node-v8-7f55349079705a9e1d43024ed45c1351907f3d8e.zip |
net: convert to using internal/errors
Covert lib/net.js over to using lib/internal/errors.js
- Replace thrown errors in lib/net.js
with errors from lib/internal/errors.
The ERR_INVALID_OPT_VALUE error have been used
in the Server.prototype.listen() method
- Update tests according to the above modifications
PR-URL: https://github.com/nodejs/node/pull/14782
Refs: https://github.com/nodejs/node/issues/11273
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'test/parallel/test-internal-errors.js')
-rw-r--r-- | test/parallel/test-internal-errors.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/parallel/test-internal-errors.js b/test/parallel/test-internal-errors.js index 93757ae66c..80edc25df1 100644 --- a/test/parallel/test-internal-errors.js +++ b/test/parallel/test-internal-errors.js @@ -216,6 +216,10 @@ assert.strictEqual( errors.message('ERR_INVALID_ARG_TYPE', [['a', 'b', 'c'], 'not d']), 'The "a", "b", "c" arguments must not be of type d'); +// Test ERR_INVALID_FD_TYPE +assert.strictEqual(errors.message('ERR_INVALID_FD_TYPE', ['a']), + 'Unsupported fd type: a'); + // Test ERR_INVALID_URL_SCHEME assert.strictEqual(errors.message('ERR_INVALID_URL_SCHEME', ['file']), 'The URL must be of scheme file'); @@ -246,6 +250,10 @@ assert.throws( message: /^At least one arg needs to be specified$/ })); +// Test ERR_SOCKET_BAD_PORT +assert.strictEqual( + errors.message('ERR_SOCKET_BAD_PORT', [0]), + 'Port should be > 0 and < 65536. Received 0.'); // Test ERR_TLS_CERT_ALTNAME_INVALID assert.strictEqual( |