Skip to content

error: document removed error codes - #22100

Closed
SirR4T wants to merge 9 commits into
nodejs:masterfrom
SirR4T:updateErrorDocs-22061
Closed

error: document removed error codes#22100
SirR4T wants to merge 9 commits into
nodejs:masterfrom
SirR4T:updateErrorDocs-22061

Conversation

@SirR4T

@SirR4TSirR4T commented Aug 3, 2018

Copy link
Copy Markdown
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines

Working towards #22061

List of errors to be documented as removed (from #21491)
  • ERR_FS_WATCHER_ALREADY_STARTED
  • ERR_FS_WATCHER_NOT_STARTED
  • ERR_HTTP2_ALREADY_SHUTDOWN
  • ERR_HTTP2_ERROR
  • ERR_HTTP2_FRAME_ERROR
  • ERR_HTTP2_HEADERS_OBJECT
  • ERR_HTTP2_HEADER_REQUIRED
  • ERR_HTTP2_INFO_HEADERS_AFTER_RESPOND
  • ERR_HTTP2_STREAM_CLOSED
  • ERR_HTTP_INVALID_CHAR
  • ERR_INVALID_ARRAY_LENGTH
  • ERR_INVALID_DOMAIN_NAME
  • ERR_INVALID_REPL_HISTORY
  • ERR_MISSING_DYNAMIC_INSTANTIATE_HOOK
  • ERR_NAPI_CONS_PROTOTYPE_OBJECT
  • ERR_OUTOFMEMORY
  • ERR_PARSE_HISTORY_DATA
  • ERR_STREAM_HAS_STRINGDECODER
  • ERR_STREAM_READ_NOT_IMPLEMENTED
  • ERR_STRING_TOO_LARGE
  • ERR_TLS_RENEGOTIATION_FAILED
  • ERR_UNKNOWN_BUILTIN_MODULE
  • ERR_VALUE_OUT_OF_RANGE
  • ERR_ZLIB_BINDING_CLOSED

@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 Aug 3, 2018
@SirR4TSirR4T mentioned this pull request Aug 3, 2018
2 tasks

@vsemozhetbytvsemozhetbyt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some initial nits.

Comment threaddoc/api/errors.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linter issue: 80 characters per line limit exceeded.

Comment threaddoc/api/errors.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linter issue: 80 characters per line limit exceeded.

Comment threaddoc/api/errors.md Outdated

@vsemozhetbytvsemozhetbytAug 3, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Linter issue: missing heading for this link?
  2. Doc tools use underscores, not hyphens in auto-created section ids, with document name prefix: #errors_legacy_node_js_error_codes for ## Legacy Node.js Error Codes.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doh! missed adding the h2 header, fixing it now. Also, realized that I don't really need the link definition at the end of the file, so removed it.

@SirR4T
SirR4Tforce-pushed the updateErrorDocs-22061 branch from 1444f20 to cbe275cCompareAugust 6, 2018 05:50
Comment threaddoc/api/errors.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may be wrong, but we may need not this hardcoded id, as the other ones in this doc may be due to legacy links support. Let us see what others think.

Comment threaddoc/api/errors.md Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if we add a "removed: v10.x.x". I guess that might not be parsed properly tough. @vsemozhetbyt do you have a suggestion for this?

@vsemozhetbytvsemozhetbytAug 6, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may add the case for removing to adding and deprecating. It seems these two function need to be updated accordingly:

functionextractAndParseYAML(text){

functionparseYAML(text){

(Just grepping 'added' or 'deprecated' and adding a similar case may do)

@SirR4TSirR4TAug 7, 2018

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BridgeAR added these sections (thanks @vsemozhetbyt, for the pointers), now shows up as
screen shot 2018-08-07 at 10 34 04 am

Although cc: @joyeecheung , because it seems to me she has some reservations against saying "removed in v10.x.x" .

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, should there be a short explanation on why this error code was removed? Something on the lines of

Like fs.watchFile(), this situation is now silently ignored.

or some such.

@joyeecheungjoyeecheungAug 8, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SirR4T I think it's OK to have removed in, but the version number should be accurate. In the case of ERR_FS_WTCHER_ALREADY_STARTED, it has never been released in any version, since the commit that added it (6c25f2e) and the commit that removed it (301f6cc) are both present from v10.0.0...v10.8.0 - which means when v10.0.0 was out, the error was not even there. Therefore, this error code has only appeared in nightly and canary releases.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do add a short explanation, we can make this in changes blocks.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it. If the error codes never actually touched the releases, what should the description look like? is having both added: v10.0.0 and removed: v10.0.0 ok?

@SirR4TSirR4TAug 22, 2018

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joyeecheung : also, I have added versions added and versions removed here, for all the commits which either added or removed the error codes. Eyeballing the versions, it seems to me that the wherever github mentions vA.a.a .. vB.b.b, we should be mentioning the vB.b.b in the docs. (For both added, as well as removed.) will that be correct?

@joyeecheungjoyeecheungAug 23, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think annotating them as added: v10.0.0 removed: v10.0.0 is more confusing than helpful. A note in the docs about that would be enough, maybe something like:

This error code has never been released and only existed in nightly builds.

@SirR4T
SirR4Tforce-pushed the updateErrorDocs-22061 branch 2 times, most recently from 218bc9e to 0c11e4dCompareAugust 7, 2018 04:45
@vsemozhetbyt

Copy link
Copy Markdown
Contributor

@SirR4T

Copy link
Copy Markdown
Author

if someone can confirm this looks good, I'll continue adding the other error codes.

@vsemozhetbytvsemozhetbyt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doc format and doctools additions LGTM.

@SirR4T

SirR4T commented Aug 22, 2018

Copy link
Copy Markdown
Author

additional info, could be useful.

Error NameRemoved in Commit : VersionsAdded in Commit : Versions
ERR_FS_WATCHER_ALREADY_STARTED301f6cc : v10.9.0 .. v10.0.06c25f2e : v10.9.0 .. v10.0.0
ERR_FS_WATCHER_NOT_STARTED301f6cc : v10.9.0 .. v10.0.06c25f2e : v10.9.0 .. v10.0.0
ERR_HTTP2_ALREADY_SHUTDOWN6e1c25c : v10.9.0 .. v10.0.00babd18 : v10.9.0 .. v10.0.0
ERR_HTTP2_ERROR1cdb41f : v10.9.0 .. v9.0.0e71e71b : v10.9.0 .. v9.0.0
ERR_HTTP2_FRAME_ERROR6e1c25c : v10.9.0 .. v10.0.0e71e71b : v10.9.0 .. v9.0.0
ERR_HTTP2_HEADERS_OBJECT6e1c25c : v10.9.0 .. v10.0.0e71e71b : v10.9.0 .. v9.0.0
ERR_HTTP2_HEADER_REQUIRED6e1c25c : v10.9.0 .. v10.0.01cdb41f : v10.9.0 .. v9.0.0
ERR_HTTP2_INFO_HEADERS_AFTER_RESPOND6e1c25c : v10.9.0 .. v10.0.0e71e71b : v10.9.0 .. v9.0.0
ERR_HTTP2_STREAM_CLOSED0babd18 : v10.9.0 .. v10.0.0e71e71b : v10.9.0 .. v9.0.0
ERR_HTTP_INVALID_CHAR6e1c25c : v10.9.0 .. v10.0.01cdb41f : v10.9.0 .. v9.0.0
ERR_INVALID_ARRAY_LENGTH186857f :8ca9338 : v10.9.0 .. v9.0.0
ERR_INVALID_DOMAIN_NAME564048d :bdfbce9 : v10.9.0 .. v9.0.0
ERR_INVALID_REPL_HISTORYe6b69b9 : v10.9.0 .. v9.0.08ca9338 : v10.9.0 .. v9.0.0
ERR_MISSING_DYNAMIC_INSTANTIATE_HOOK6e1c25c : v10.9.0 .. v10.0.014181a3 : v10.9.0 .. v10.0.0
ERR_NAPI_CONS_PROTOTYPE_OBJECT6e1c25c : v10.9.0 .. v10.0.01cdb41f : v10.9.0 .. v9.0.0
ERR_OUTOFMEMORYa82b1b7 : v10.9.0 .. v10.0.01cdb41f : v10.9.0 .. v9.0.0
ERR_PARSE_HISTORY_DATA6e1c25c : v10.9.0 .. v10.0.08ca9338 : v10.9.0 .. v9.0.0
ERR_STREAM_HAS_STRINGDECODER1b54371 : v10.9.0 .. v9.0.08ca9338 : v10.9.0 .. v9.0.0
ERR_STREAM_READ_NOT_IMPLEMENTEDc979488 : v10.9.0 .. v10.0.088fb359 : v10.9.0 .. v9.0.0
ERR_STRING_TOO_LARGE3626944 : v10.9.0 .. v10.0.0289d152 : v10.9.0 .. v10.0.0
ERR_TLS_RENEGOTIATION_FAILED6e1c25c : v10.9.0 .. v10.0.01cdb41f : v10.9.0 .. v9.0.0
ERR_UNKNOWN_BUILTIN_MODULE1cdb41f : v10.9.0 .. v9.0.0251e5ed : v10.9.0 .. v8.0.0
ERR_VALUE_OUT_OF_RANGEd022cb1 : v10.9.0 .. v10.0.04d893e0 : v10.9.0 .. v9.0.0
ERR_ZLIB_BINDING_CLOSED5e3f516 : v10.9.0 .. v10.0.07489141 : v10.9.0 .. v9.0.0

@SirR4T
SirR4Tforce-pushed the updateErrorDocs-22061 branch from dcc5a1b to dd31edeCompareAugust 23, 2018 05:15
@SirR4TSirR4T changed the title [WIP] error: document removed error codeserror: document removed error codesAug 23, 2018
Comment threaddoc/api/errors.md Outdated
removed: v10.0.0
-->

HTTP/2 Informational headers must only be sent *prior* to calling the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Informational -> informational (lower case).

Comment threaddoc/api/errors.md Outdated
removed: REPLACEME
-->

Used when `hostname` can not be parsed from a provided URL.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can not -> cannot

Comment threaddoc/api/errors.md Outdated
removed: v10.0.0
-->

The `repl` module was unable parse data from the REPL history file.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unable parse -> unable to parse

Comment threaddoc/api/errors.md Outdated

Used to prevent an abort if a string decoder was set on the Socket.

Example

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe omit the word Example as obvious.

Comment threaddoc/api/errors.md Outdated
const Socket = require('net').Socket;
const instance = new Socket();

instance.setEncoding('utf-8');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'utf-8' -> 'utf8'

@joyeecheung

Copy link
Copy Markdown
Member

Thanks for digging into this! On how to document the added and removed fields, in general:

  1. If the commit that added the code and the commit that removed code appear in the same set of tags, then the code has never actually been released. In this case I think adding a note like This error code has never been released and only existed in nightly builds. would be enough.
  2. If the commit that removed the code has not appear in any tags, that means it has not been actually removed in releases. We should leave them out in this PR and document them in another PR with the dont-land or semver-major labels similar to the PR that removes it.
  3. If the commit that added the code and the commit that removed code appear in different set of tags, then the smalles tag where the adding commit appears is what added field should be, and the smallest tag where the removing commit appears is what the removed field should be

Documentation can be added once the PRs land on a release.
Do not add documentation for those error codes yet.
[See point 2 here](nodejs#22100 (comment)).
@SirR4T

Copy link
Copy Markdown
Author

@vsemozhetbyt : regarding 1., I believe current YAML for doc sections only supports added, removed, and changes. Any idea on how to add the This error code has never been released and only existed in nightly builds. comment to all the relevant codes? Do we support footnotes / references like wikipedia does? Seems a waste to me, to add the same line duplicated in every relevant section.

regarding 2., have removed docs for the two error codes (ERR_INVALID_ARRAY_LENGTH and ERR_INVALID_DOMAIN_NAME) in this PR, and raised #22496 for the same.

regarding 3., yay! I was on track.

@vsemozhetbyt

Copy link
Copy Markdown
Contributor

@SirR4T As changes: section items also require version keys, I cannot think of any ready appropriate place for this. @nodejs/documentation, are there any common places for these notes or should we introduce a new way to express them?

@joyeecheung

joyeecheung commented Aug 24, 2018

Copy link
Copy Markdown
Member

@SirR4T

I believe current YAML for doc sections only supports added, removed, and changes. Any idea on how to add the This error code has never been released and only existed in nightly builds. comment to all the relevant codes? Do we support footnotes / references like wikipedia does? Seems a waste to me, to add the same line duplicated in every relevant section.

I think we can just skip those? If they are not even released there is no point adding those fields. A note in the docs would be enough.

@SirR4T

Copy link
Copy Markdown
Author

@joyeecheung@vsemozhetbyt Have moved these errors to another list, as I wasn't sure how to add a note. Lemme know if this looks good..

Comment threaddoc/api/errors.md Outdated
Used when an attempt is made to use a `zlib` object after it has already been
closed.

<a id="unreleased_error_codes">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this anchor is unneeded (as well as the <a id="legacy-nodejs-error-codes"></a> above). We use hardcoded anchors only for error headings in this doc.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. Also, any other suggestions welcome, for the last section description. The current These errors have never been released, but had been present on master between releases. seems to assume knowledge of the git repo on the behalf of a reader.

@vsemozhetbyt

Copy link
Copy Markdown
Contributor

It seems like a good solution for me.

Comment threadtools/doc/common.js
}

if (meta.removed) {
meta.removed = arrify(meta.removed);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed for this PR? From what I can tell we only used single removed fields here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was blindly copy pasting wherever added occurred.

Maybe not for this particular PR, but if we're planning to add removed as a feature for api docs, would rather it supports semver-minors as well, like added and deprecated.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SirR4T Ah, sorry, I thought we already had removed before, looks like it is new in this PR...

@joyeecheungjoyeecheung left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, thanks for picking this up!

One note: this should be landed as two commits, one for the doc change and one for the tools change

@joyeecheung

Copy link
Copy Markdown
Member

vsemozhetbyt pushed a commit that referenced this pull request Aug 26, 2018
PR-URL: #22100
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
vsemozhetbyt pushed a commit that referenced this pull request Aug 26, 2018
PR-URL: #22100Fixes: #22061
Refs: #21491
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
@vsemozhetbyt

Copy link
Copy Markdown
Contributor

Landed in e10290c...e9876fd
Thank you!

@SirR4T
SirR4T deleted the updateErrorDocs-22061 branch August 26, 2018 08:29
addaleax pushed a commit that referenced this pull request Aug 27, 2018
PR-URL: #22100
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
addaleax pushed a commit that referenced this pull request Aug 27, 2018
PR-URL: #22100Fixes: #22061
Refs: #21491
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
targos pushed a commit that referenced this pull request Sep 3, 2018
PR-URL: #22100
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
targos pushed a commit that referenced this pull request Sep 3, 2018
PR-URL: #22100Fixes: #22061
Refs: #21491
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
@targostargos mentioned this pull request Sep 5, 2018
targos pushed a commit that referenced this pull request Sep 6, 2018
PR-URL: #22100
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
targos pushed a commit that referenced this pull request Sep 6, 2018
PR-URL: #22100Fixes: #22061
Refs: #21491
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docIssues and PRs related to the documentations.errorsIssues and PRs related to JavaScript errors originated in Node.js core.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@SirR4T@vsemozhetbyt@joyeecheung@BridgeAR@nodejs-github-bot