Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discrepancies between error list and documentation #15038

Closed
24 tasks
maclover7 opened this issue Aug 26, 2017 · 3 comments
Closed
24 tasks

Discrepancies between error list and documentation #15038

maclover7 opened this issue Aug 26, 2017 · 3 comments
Labels
doc Issues and PRs related to the documentations. errors Issues and PRs related to JavaScript errors originated in Node.js core.

Comments

@maclover7
Copy link
Contributor

maclover7 commented Aug 26, 2017

There are a few discrepancies between the errors defined in lib/internal/errors.js and those appearing in the documentation in doc/api/errors.md. The differences are outlined below (I compiled this list manually, and it's possible some errors are missing -- please comment if so!!), and this should be fairly straightforward to solve -- people would just need to submit PRs to fill in the missing documentation :)

cc @Trott


yes lib/internal/errors.js, no doc/api/errors.md

  • ERR_ASYNC_CALLBACK
  • ERR_ASYNC_TYPE
  • ERR_ENCODING_NOT_SUPPORTED
  • ERR_ENCODING_INVALID_ENCODED_DATA
  • ERR_HTTP_INVALID_CHAR
  • ERR_HTTP2_HEADER_REQUIRED
  • ERR_HTTP2_HEADERS_AFTER_RESPOND
  • ERR_HTTP2_INVALID_PACKED_SETTINGS_LENGTH
  • ERR_INVALID_ASYNC_ID
  • ERR_NAPI_CONS_FUNCTION
  • ERR_NAPI_CONS_PROTOTYPE_OBJECT
  • ERR_PARSE_HISTORY_DATA
  • ERR_INVALID_PERFORMANCE_MARK
  • ERR_OUTOFMEMORY
  • ERR_TLS_CERT_ALTNAME_INVALID
  • ERR_TLS_DH_PARAM_SIZE
  • ERR_TLS_HANDSHAKE_TIMEOUT
  • ERR_TLS_RENEGOTIATION_FAILED
  • ERR_TLS_REQUIRED_SERVER_NAME
  • ERR_TLS_SESSION_ATTACK
  • ERR_TRANSFORM_ALREADY_TRANSFORMING
  • ERR_TRANSFORM_WITH_LENGTH_0
  • ERR_VALID_PERFORMANCE_ENTRY_TYPE

no lib/internal/errors.js, yes doc/api/errors.md

  • ERR_HTTP2_ERROR

Something else to consider is how to prevent this from happening in the future. I've been playing around with some ESLint stuff, but would appreciate people's thoughts on this.

@mscdex mscdex added doc Issues and PRs related to the documentations. errors Issues and PRs related to JavaScript errors originated in Node.js core. labels Aug 26, 2017
@refack
Copy link
Contributor

refack commented Aug 27, 2017

@maclover7 thank you for doing this!
For context, there is a medium-term goal of refactoring out the error codes from internal/errors.js into a resource file that could be shared with other modules more easily. This will probably also make linting the docs for discrepancies much more simple.
Also since all the errors changes are semver-major we plan on auditing all the codes before v9.x is compiled.
Until then IMHO human auditing (during PRs that introduce new codes, and systematic reviews like you just did) are probably the most cost effective.

/cc @jasnell

@gnbezerra
Copy link
Contributor

gnbezerra commented Aug 30, 2017

Is this good for a first PR, I guess? Correct me if I'm wrong.

Anyway, I'll try to submit a PR by tomorrow updating the errors in the documentation.

Edit: taking a bit more time than I expected due to other obligations, but I'm still on it.

@gnbezerra
Copy link
Contributor

About the list @maclover7 compiled, just a few corrections to it:

  • ERR_HTTP2_INVALID_PACKED_SETTINGS_LENGTH is listed both in lib/internal/errors.js and doc/api/errors.md
  • ERR_SOCKET_CLOSED is listed in lib/internal/errors.js, but not listed in doc/api/errors.md
  • ERR_UNKNOWN_BUILTIN_MODULE is not listed in lib/internal/errors.js, but is listed in doc/api/errors.md

Oh, and thank you for calling attention to this issue, @maclover7!

addaleax pushed a commit to addaleax/node that referenced this issue Sep 13, 2017
There are discrepancies between the errors defined in
`lib/internal/errors.js` and those documented in `doc/api/errors.md`.
Some of the errors recently defined are not documented, while others
were removed, but still have entries in the docs. This commit fills in
those gaps in the documentation.

PR-URL: nodejs#15160
Fixes: nodejs#15038
Reviewed-By: James M Snell <jasnell@gmail.com>
gibfahn pushed a commit that referenced this issue Oct 30, 2017
There are discrepancies between the errors defined in
`lib/internal/errors.js` and those documented in `doc/api/errors.md`.
Some of the errors recently defined are not documented, while others
were removed, but still have entries in the docs. This commit fills in
those gaps in the documentation.

PR-URL: #15160
Backport-PR-URL: #16556
Fixes: #15038
Reviewed-By: James M Snell <jasnell@gmail.com>
gibfahn pushed a commit that referenced this issue Oct 31, 2017
There are discrepancies between the errors defined in
`lib/internal/errors.js` and those documented in `doc/api/errors.md`.
Some of the errors recently defined are not documented, while others
were removed, but still have entries in the docs. This commit fills in
those gaps in the documentation.

PR-URL: #15160
Backport-PR-URL: #16556
Fixes: #15038
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. errors Issues and PRs related to JavaScript errors originated in Node.js core.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants