GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — doc: restore documentation for two error codes by ChALkeR · Pull Request #21484 · nodejs/node Conversation
|
| // eslint-disable-next-line no-restricted-syntax | |
| const err = new Error(`No such built-in module: ${id}`); | |
| err.code = 'ERR_UNKNOWN_BUILTIN_MODULE'; | |
| err.name = 'Error [ERR_UNKNOWN_BUILTIN_MODULE]'; | |
| throw err; |
node/lib/internal/http2/util.js
Lines 471 to 478 in a40e062
| class NghttpError extends Error { | |
| constructor(ret) { | |
| super(binding.nghttp2ErrorString(ret)); | |
| this.code = 'ERR_HTTP2_ERROR'; | |
| this.name = 'Error [ERR_HTTP2_ERROR]'; | |
| this.errno = ret; | |
| } | |
| } |
make -j4 test (UNIX), or vcbuild test (Windows) passes
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@ChALkeR build started: https://ci.nodejs.org/blue/organizations/jenkins/node-test-pull-request-lite-pipeline/detail/node-test-pull-request-lite-pipeline/131/pipeline |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
/cc @gnbezerra, @BridgeAR, @jasnell |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Note: I consider this as a partial revert and specifically do not want to change the documentation of those error codes in the process of restoring it — that should be done separately, if needed. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
8.x, 9.x, 10.x are affected, 6.x is not affected. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
👍 on this comment for fast-track (sorry for not mentioning it earlier). |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
ERR_HTTP2_ERROR and ERR_UNKNOWN_BUILTIN_MODULE error codes documentation seem to have been accidentally removed in commit 1cdb41f (pull request nodejs#15160). This reverts that removal, restoring the documentation for those two error codes. Those error codes are used from lib/ folder. This is a part of the fixes hinted by nodejs#21470, which includes some tests for error codes usage and documentation and enforces a stricter format. PR-URL: nodejs#21484 Refs: nodejs#21470 Refs: nodejs#21440 Refs: nodejs#15160 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
537c41a to
cdb5985
Compare
|
Landed in cdb5985, thanks! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
ERR_HTTP2_ERROR and ERR_UNKNOWN_BUILTIN_MODULE error codes documentation seem to have been accidentally removed in commit 1cdb41f (pull request #15160). This reverts that removal, restoring the documentation for those two error codes. Those error codes are used from lib/ folder. This is a part of the fixes hinted by #21470, which includes some tests for error codes usage and documentation and enforces a stricter format. PR-URL: #21484 Refs: #21470 Refs: #21440 Refs: #15160 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
This adds several sanity checks for error codes.
It scans:
* all natives (js sources),
* doc/api/*.md documentation
* src/node_errors.h (errors definition from the C++ side).
There is also a whitelist of manually created errors from JS side,
currently consisting of ERR_HTTP2_ERROR and ERR_UNKNOWN_BUILTIN_MODULE.
Alsom all ERR_NAPI_ codes are whitelisted, as those are created directly
on the cpp side, without declaring them first.
The performed checks:
1. All errors used from JS should be defined in `internal/errors` and
present in its .codes object. Whitelist (mentioned above) applies.
2. All errors instantiated from JS without arguments should support
0-arguments version.
3. All errors mentioned in doc should defined either in JS, C++, or
in the whitelist.
4. All errors mentioned anywhere should be documented.
5. Documentation of error codes should be sorted, have no repeats,
and include exactly one entry for every error code mentioned in
the documentation, formatted as `/\n### (ERR_[A-Z0-9_]+)\n`.
6. All doc entries for error codes should have appropriate anchors.
There is also a --report flag, which prints all the current issues and
exits without asserting, for manual inspection.
Individual fixes for those issues are landed in separate commits.
Refs: nodejs#21421
Refs: nodejs#21440
Refs: nodejs#21483
Refs: nodejs#21484
Refs: nodejs#21485
Refs: nodejs#21487
PR-URL: nodejs#21470
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.