Skip to content

doc: sort error codes in errors.md - #21485

Merged
ChALkeR merged 1 commit into
nodejs:masterfrom
ChALkeR:doc-errcodes-sort
Jun 24, 2018
Merged

doc: sort error codes in errors.md#21485
ChALkeR merged 1 commit into
nodejs:masterfrom
ChALkeR:doc-errcodes-sort

Conversation

@ChALkeR

@ChALkeRChALkeR commented Jun 23, 2018

Copy link
Copy Markdown
Member

Sort all error code blocks in doc/api/errors.md.

A single exception is that ERR_HTTP2_* comes after ERR_HTTP_*.

Actual content not changed, just some blocks are moved around.

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.

Refs: #21470, #21440

Tests are not included — #21470 does that.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@ChALkeRChALkeR added doc Issues and PRs related to the documentations. errors Issues and PRs related to JavaScript errors originated in Node.js core. labels Jun 23, 2018
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-botnodejs-github-bot added doc Issues and PRs related to the documentations. errors Issues and PRs related to JavaScript errors originated in Node.js core. labels Jun 23, 2018
@ChALkeRChALkeR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jun 23, 2018
@ChALkeR

Copy link
Copy Markdown
MemberAuthor

👍 on this comment for fast-track.

@ChALkeRChALkeR added the fast-track PRs that do not need to wait for 48 hours to land. label Jun 24, 2018
A single exception is that ERR_HTTP2_* comes after ERR_HTTP_*.
Actual content not changed, just some blocks are moved around.
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#21485
Refs: nodejs#21470
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
@ChALkeR

Copy link
Copy Markdown
MemberAuthor

Landed in 5ab3db7, thanks!

@ChALkeR
ChALkeR merged commit 5ab3db7 into nodejs:masterJun 24, 2018
targos pushed a commit that referenced this pull request Jun 24, 2018
A single exception is that ERR_HTTP2_* comes after ERR_HTTP_*.
Actual content not changed, just some blocks are moved around.
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: #21485
Refs: #21470
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
@targostargos mentioned this pull request Jul 3, 2018
ChALkeR added a commit to ChALkeR/io.js that referenced this pull request Sep 8, 2018
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
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.docIssues and PRs related to the documentations.errorsIssues and PRs related to JavaScript errors originated in Node.js core.fast-trackPRs that do not need to wait for 48 hours to land.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@ChALkeR@nodejs-github-bot@lpinca@targos@cjihrig@vsemozhetbyt@trivikr