node/doc/api
Denys Otrishko c66e6471e7
lib: remove ERR_INVALID_OPT_VALUE and ERR_INVALID_OPT_VALUE_ENCODING
This will be a start to generalize all argument validation
errors. As currently we throw ARG/OPT, OUT_OF_RANGE, and other more
specific errors.
The OPT errors didn't bring much to the errors as it's just another
variant of ARG error which is sometimes more confusing (some of our code
used OPT errors to denote just argument validation errors presumably
because of similarity of OPT to 'option' and not 'options-object')
and they don't specify the name of the options object where the invalid
value is located. Much better approach would be to just specify path
to the invalid value in the name of the value as it is done in this PR
(i.e. 'options.format', 'options.publicKey.type' etc)

Also since this decreases a variety of errors we have it'd be easier to
reuse validation code across the codebase.

Refs: https://github.com/nodejs/node/pull/31251
Refs: https://github.com/nodejs/node/pull/34070#discussion_r467251009
Signed-off-by: Denys Otrishko <shishugi@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/34682
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-09-11 17:54:42 +03:00
..
addons.md doc: simplify "make use of" to "use" 2020-08-28 07:11:09 -07:00
assert.md doc: fix malformed hashes in assert.md 2020-09-05 06:50:43 -07:00
async_hooks.md doc: improve async_hooks snippets 2020-08-18 15:16:05 -07:00
buffer.md lib: remove ERR_INVALID_OPT_VALUE and ERR_INVALID_OPT_VALUE_ENCODING 2020-09-11 17:54:42 +03:00
child_process.md doc: reword warnings about sockets passed to subprocesses 2020-07-11 21:03:03 -07:00
cli.md doc,test: specify and test CLI option precedence rules 2020-09-11 10:31:35 +02:00
cluster.md doc: add dynamic source code links 2020-06-26 10:25:14 -07:00
console.md doc: simplify and clarify console.assert() documentation 2020-07-31 23:37:13 -07:00
crypto.md 2020-09-08, Version 14.10.0 (Current) 2020-09-08 11:35:08 -04:00
debugger.md doc: use sentence-case for headings in docs 2020-06-19 08:09:05 -07:00
deprecations.md doc: fix broken links in deprecations.md 2020-09-10 19:42:54 -07:00
dgram.md doc: improve link-local text in dgram.md 2020-08-26 06:41:21 -07:00
dns.md 2020-07-22, Version 12.18.3 'Erbium' (LTS) 2020-07-22 09:54:26 -07:00
documentation.md doc: use sentence-case for headings in docs 2020-06-19 08:09:05 -07:00
domain.md doc: add dynamic source code links 2020-06-26 10:25:14 -07:00
embedding.md test,doc: add missing uv_setup_args() calls 2020-08-14 15:29:29 -07:00
errors.md lib: remove ERR_INVALID_OPT_VALUE and ERR_INVALID_OPT_VALUE_ENCODING 2020-09-11 17:54:42 +03:00
esm.md doc: error code fix in resolver spec 2020-09-03 16:33:04 -07:00
events.md doc: use correct Error type for EventEmitter.defaultMaxListener 2020-09-07 08:20:27 -07:00
fs.md doc: fix broken link in fs.md 2020-09-10 19:44:38 -07:00
globals.md doc: use sentence-case for headings in docs 2020-06-19 08:09:05 -07:00
http2.md doc: fix broken link in http2.md 2020-09-10 19:46:29 -07:00
http.md doc: update http server response 'close' event 2020-08-10 17:52:32 -07:00
https.md doc: add dynamic source code links 2020-06-26 10:25:14 -07:00
index.md doc: move package config docs to separate page 2020-08-29 03:02:45 -04:00
inspector.md doc: add dynamic source code links 2020-06-26 10:25:14 -07:00
intl.md doc: use sentence-case for headings in docs 2020-06-19 08:09:05 -07:00
module.md doc: make minor improvements to module.md 2020-09-08 17:22:37 -07:00
modules.md doc: rename module pages 2020-08-23 04:59:42 -07:00
n-api.md 2020-09-08, Version 14.10.0 (Current) 2020-09-08 11:35:08 -04:00
net.md net: introduce net.BlockList 2020-08-11 11:13:17 -07:00
os.md doc,tools: remove malfunctioning Linux manpage linker 2020-09-02 07:55:43 -07:00
packages.md doc: move package config docs to separate page 2020-08-29 03:02:45 -04:00
path.md doc: add note about path.basename on Windows 2020-09-10 06:05:47 -07:00
perf_hooks.md doc: fix broken link in perf_hooks.md 2020-09-10 20:15:29 -07:00
policy.md doc: make general copy-edit changes to policy.md 2020-08-29 06:53:00 -07:00
process.md doc: provide more guidance about process.version 2020-08-27 06:59:15 -07:00
punycode.md doc: add dynamic source code links 2020-06-26 10:25:14 -07:00
querystring.md doc: add dynamic source code links 2020-06-26 10:25:14 -07:00
quic.md doc: fix incorrectly marked Buffer in quic.md 2020-09-08 06:11:12 -07:00
readline.md doc: add a note about possible missing lines to readline.asyncIterator 2020-08-29 16:14:42 -07:00
repl.md doc: add missing changes entry for breakEvalOnSigint REPL option 2020-09-11 14:45:35 +00:00
report.md doc: use sentence-case for headings in docs 2020-06-19 08:09:05 -07:00
stream.md doc: add writable and readable options to Duplex docs 2020-08-10 12:20:19 +08:00
string_decoder.md doc: add dynamic source code links 2020-06-26 10:25:14 -07:00
synopsis.md doc: use sentence-case for headings in docs 2020-06-19 08:09:05 -07:00
timers.md 2020-08-27, Version 14.9.0 (Current) 2020-08-27 15:44:13 +01:00
tls.md doc: fix certificate display in tls doc 2020-09-05 09:45:06 -07:00
tracing.md doc: add dynamic source code links 2020-06-26 10:25:14 -07:00
tty.md doc: add dynamic source code links 2020-06-26 10:25:14 -07:00
url.md doc: add deprecated badge to legacy URL methods 2020-09-06 16:33:56 -04:00
util.md 2020-08-27, Version 14.9.0 (Current) 2020-08-27 15:44:13 +01:00
v8.md doc: add dynamic source code links 2020-06-26 10:25:14 -07:00
vm.md doc: fix a typo of microtaskMode 2020-09-05 12:00:45 +00:00
wasi.md 2020-07-21, Version 14.6.0 (Current) 2020-07-21 17:45:12 -04:00
worker_threads.md 2020-08-27, Version 14.9.0 (Current) 2020-08-27 15:44:13 +01:00
zlib.md 2020-06-30, Version 14.5.0 (Current) 2020-06-30 15:27:43 -07:00