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/parallel/test-fs-watch.js | |
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/parallel/test-fs-watch.js')
-rw-r--r-- | test/parallel/test-fs-watch.js | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/test/parallel/test-fs-watch.js b/test/parallel/test-fs-watch.js index fb674bbfea..ea24f406cc 100644 --- a/test/parallel/test-fs-watch.js +++ b/test/parallel/test-fs-watch.js @@ -89,9 +89,7 @@ for (const testCase of cases) { () => fs.watch(input, common.mustNotCall()), { code: 'ERR_INVALID_ARG_TYPE', - type: TypeError, - message: 'The "filename" argument must be one of type string, Buffer, ' + - `or URL. Received type ${typeof input}` + type: TypeError } ); }); |