diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2019-09-23 08:17:25 +0200 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2019-12-20 03:10:13 +0100 |
commit | ac2fc0dd5f5830d32dd89fe1c9c55d672cf59c0a (patch) | |
tree | 36d2e1a22d86269244d244f69acf4b46c42ea818 /test/internet | |
parent | fc28761d771e676c57be92c99ab4e04f749c53f4 (diff) | |
download | node-new-ac2fc0dd5f5830d32dd89fe1c9c55d672cf59c0a.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/internet')
-rw-r--r-- | test/internet/test-dns-promises-resolve.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/internet/test-dns-promises-resolve.js b/test/internet/test-dns-promises-resolve.js index 6291e0365c..b9e7fa4230 100644 --- a/test/internet/test-dns-promises-resolve.js +++ b/test/internet/test-dns-promises-resolve.js @@ -26,7 +26,7 @@ const dnsPromises = require('dns').promises; code: 'ERR_INVALID_ARG_TYPE', type: TypeError, message: 'The "rrtype" argument must be of type string. ' + - `Received type ${typeof rrtype}` + `Received type ${typeof rrtype} (${rrtype})` } ); } |