summaryrefslogtreecommitdiff
path: root/test/parallel/test-http2-createserver-options.js
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2019-09-23 08:17:25 +0200
committerBeth Griggs <Bethany.Griggs@uk.ibm.com>2020-02-06 02:49:32 +0000
commitdf94cfb67c40768b7d5999bb164cfbea58988ffc (patch)
tree886c74c00d56fc223f2f266bc26ee3771f94a4c4 /test/parallel/test-http2-createserver-options.js
parentae3459af9f1a1026ba25b7cde3a80357c73d6d39 (diff)
downloadnode-new-df94cfb67c40768b7d5999bb164cfbea58988ffc.tar.gz
errors: improve ERR_INVALID_ARG_TYPE
ERR_INVALID_ARG_TYPE is the most common error used throughout the code base. This improves the error message by providing more details to the user and by indicating more precisely which values are allowed ones and which ones are not. It adds the actual input to the error message in case it's a primitive. If it's a class instance, it'll print the class name instead of "object" and "falsy" or similar entries are not named "type" anymore. PR-URL: https://github.com/nodejs/node/pull/29675 Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'test/parallel/test-http2-createserver-options.js')
-rw-r--r--test/parallel/test-http2-createserver-options.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/parallel/test-http2-createserver-options.js b/test/parallel/test-http2-createserver-options.js
index 6f3d4b5693..8814e2db9e 100644
--- a/test/parallel/test-http2-createserver-options.js
+++ b/test/parallel/test-http2-createserver-options.js
@@ -15,8 +15,8 @@ invalidOptions.forEach((invalidOption) => {
{
name: 'TypeError',
code: 'ERR_INVALID_ARG_TYPE',
- message: 'The "options" argument must be of type Object. Received ' +
- `type ${typeof invalidOption}`
+ message: 'The "options" argument must be of type object.' +
+ common.invalidArgTypeHelper(invalidOption)
}
);
});
@@ -28,8 +28,8 @@ invalidOptions.forEach((invalidSettingsOption) => {
{
name: 'TypeError',
code: 'ERR_INVALID_ARG_TYPE',
- message: 'The "options.settings" property must be of type Object. ' +
- `Received type ${typeof invalidSettingsOption}`
+ message: 'The "options.settings" property must be of type object.' +
+ common.invalidArgTypeHelper(invalidSettingsOption)
}
);
});