-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
doc: make error descriptions more concise #16954
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left a few comments, some are just adding a comma here or there, feel free to treat as nits :)
doc/api/errors.md
Outdated
|
||
<a id="ERR_CPU_USAGE"></a> | ||
### ERR_CPU_USAGE | ||
|
||
Used when the native call from `process.cpuUsage` cannot be processed properly. | ||
The native call from `process.cpuUsage` could be processed properly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could --> could not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. I also removed properly
as it seems superfluous.
doc/api/errors.md
Outdated
|
||
<a id="ERR_CRYPTO_FIPS_UNAVAILABLE"></a> | ||
### ERR_CRYPTO_FIPS_UNAVAILABLE | ||
|
||
Used when trying to enable or disable FIPS mode when FIPS is not available. | ||
There was an attempt to enable or disable FIPS mode but FIPS mode is not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comma after disable FIPS mode
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, thanks
doc/api/errors.md
Outdated
|
||
<a id="ERR_HTTP2_HEADER_SINGLE_VALUE"></a> | ||
### ERR_HTTP2_HEADER_SINGLE_VALUE | ||
|
||
Used when multiple values have been provided for an HTTP header field that | ||
required to have only a single value. | ||
Multiple values have been provided for an HTTP header field that is required to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it wasn't there originally, but should HTTP be changes to HTTP/2?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would seem so. Done.
doc/api/errors.md
Outdated
|
||
<a id="ERR_HTTP2_PUSH_DISABLED"></a> | ||
### ERR_HTTP2_PUSH_DISABLED | ||
|
||
Used when push streams have been disabled by the client but an attempt to | ||
create a push stream is made. | ||
Push streams have been disabled by the client but an attempt to create a push |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comma after by the client
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. FWIW, once the error conversion is complete, I'm planning a sprint of changes to fill in the details on these errors in the docs, including example code (where possible) showing how to trigger the error and an explanation on how to fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making @maclover7 's nit explicit - otherwise looks like a nice positive change
@benjamingr I've addressed all of @maclover7's nits and also edited a few more messages that landed since I originally opened this. PTAL. (I left these changes in separate commits for easier reviewing if you don't want to read everything all over again.) |
LGTM |
@Trott just in case you haven't noticed I've approved those changes (after your commit but before your comment). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a bunch of suggestions...for better consistency 😅
doc/api/errors.md
Outdated
|
||
<a id="ERR_SOCKET_BAD_TYPE"></a> | ||
### ERR_SOCKET_BAD_TYPE | ||
|
||
Used when an API function expecting a socket type (`udp4` or `udp6`) receives an | ||
invalid value. | ||
An API function expecting a socket type (`udp4` or `udp6`) receivee an invalid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an extra e in receivee
doc/api/errors.md
Outdated
Used when an attempt is made to close the `process.stderr` stream. By design, | ||
Node.js does not allow `stdout` or `stderr` Streams to be closed by user code. | ||
An attempt was made to close the `process.stderr` stream. By design, Node.js | ||
does not allow `stdout` or `stderr` Streams to be closed by user code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/Streams/streams
?
doc/api/errors.md
Outdated
Used when an attempt is made to close the `process.stdout` stream. By design, | ||
Node.js does not allow `stdout` or `stderr` Streams to be closed by user code. | ||
An attempt was made to close the `process.stdout` stream. By design, Node.js | ||
does not allow `stdout` or `stderr` Streams to be closed by user code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/Streams/streams
?
doc/api/errors.md
Outdated
|
||
<a id="ERR_UNESCAPED_CHARACTERS"></a> | ||
### ERR_UNESCAPED_CHARACTERS | ||
|
||
Used when a string that contains unescaped characters was received. | ||
A string that contains unescaped characters was received. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/contains/contained/
?
doc/api/errors.md
Outdated
|
||
<a id="ERR_UNKNOWN_FILE_EXTENSION"></a> | ||
### ERR_UNKNOWN_FILE_EXTENSION | ||
|
||
> Stability: 1 - Experimental | ||
|
||
Used when attempting to load a module with an unknown or unsupported file | ||
extension. | ||
Attempting to load a module with an unknown or unsupported file extension. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous descriptions are using an attempt was made to...
, we may want to be consistent here.
doc/api/errors.md
Outdated
|
||
<a id="ERR_CRYPTO_HASH_DIGEST_NO_UTF16"></a> | ||
### ERR_CRYPTO_HASH_DIGEST_NO_UTF16 | ||
|
||
Used when the UTF-16 encoding is used with [`hash.digest()`][]. While the | ||
The UTF-16 encoding was used with [`hash.digest()`][]. While the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra space at the end.
doc/api/errors.md
Outdated
|
||
<a id="ERR_CRYPTO_FIPS_UNAVAILABLE"></a> | ||
### ERR_CRYPTO_FIPS_UNAVAILABLE | ||
|
||
Used when trying to enable or disable FIPS mode when FIPS is not available. | ||
There was an attempt to enable or disable FIPS mode, but FIPS mode is not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency, An attempt was made to enable...but FIPS mode was not available.
doc/api/errors.md
Outdated
|
||
<a id="ERR_ASYNC_TYPE"></a> | ||
### ERR_ASYNC_TYPE | ||
|
||
Used when the type of an asynchronous resource is invalid. Note that users are | ||
also able to define their own types when using the public embedder API. | ||
The type of an asynchronous resource is invalid. Note that users are also able |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/is/was/
doc/api/errors.md
Outdated
Used when the type of an asynchronous resource is invalid. Note that users are | ||
also able to define their own types when using the public embedder API. | ||
The type of an asynchronous resource is invalid. Note that users are also able | ||
to define their own types when using the public embedder API. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe drop the when
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'll go with if
instead.
doc/api/errors.md
Outdated
@@ -599,182 +599,180 @@ found [here][online]. | |||
<a id="ERR_ARG_NOT_ITERABLE"></a> | |||
### ERR_ARG_NOT_ITERABLE | |||
|
|||
Used generically to identify that an iterable argument (i.e. a value that works | |||
with `for...of` loops) is required, but not provided to a Node.js API. | |||
An iterable argument (i.e. a value that works with `for...of` loops) is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/is/was/
Remove the practice of starting most error descriptions with "Used when" or wordier variations. Change errors of the form: > Used when the type of an asynchronous resource is invalid. ...to: > The type of an asynchronous resource was invalid. Change errors of the form: > The `'ERR_INVALID_CURSOR_POS'` is thrown specifically when a cursor on > a given stream is attempted to move to a specified row without a specified > column. ...to: > A cursor on a given stream cannot be moved to a specified row without > a specified column.
Addressed almost all of the awesome nits from @joyeecheung. PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for bearing with me :D
Remove the practice of starting most error descriptions with "Used when" or wordier variations. Change errors of the form: > Used when the type of an asynchronous resource is invalid. ...to: > The type of an asynchronous resource was invalid. Change errors of the form: > The `'ERR_INVALID_CURSOR_POS'` is thrown specifically when a cursor on > a given stream is attempted to move to a specified row without a > specified column. ...to: > A cursor on a given stream cannot be moved to a specified row without > a specified column. PR-URL: nodejs#16954 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Landed in 959c425. |
Should this be backported to |
Remove the practice of starting most error descriptions with "Used when" or wordier variations. Change errors of the form: > Used when the type of an asynchronous resource is invalid. ...to: > The type of an asynchronous resource was invalid. Change errors of the form: > The `'ERR_INVALID_CURSOR_POS'` is thrown specifically when a cursor on > a given stream is attempted to move to a specified row without a > specified column. ...to: > A cursor on a given stream cannot be moved to a specified row without > a specified column. PR-URL: nodejs#16954 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
@MylesBorins Backport is in #17622 |
Remove the practice of starting most error descriptions with "Used when" or wordier variations. Change errors of the form: > Used when the type of an asynchronous resource is invalid. ...to: > The type of an asynchronous resource was invalid. Change errors of the form: > The `'ERR_INVALID_CURSOR_POS'` is thrown specifically when a cursor on > a given stream is attempted to move to a specified row without a > specified column. ...to: > A cursor on a given stream cannot be moved to a specified row without > a specified column. Backport-PR-URL: #17622 PR-URL: #16954 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Remove the practice of starting most error descriptions with "Used when" or wordier variations. Change errors of the form: > Used when the type of an asynchronous resource is invalid. ...to: > The type of an asynchronous resource was invalid. Change errors of the form: > The `'ERR_INVALID_CURSOR_POS'` is thrown specifically when a cursor on > a given stream is attempted to move to a specified row without a > specified column. ...to: > A cursor on a given stream cannot be moved to a specified row without > a specified column. Backport-PR-URL: #17622 PR-URL: #16954 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Remove the practice of starting most error descriptions with "Used when" or wordier variations. Change errors of the form: > Used when the type of an asynchronous resource is invalid. ...to: > The type of an asynchronous resource was invalid. Change errors of the form: > The `'ERR_INVALID_CURSOR_POS'` is thrown specifically when a cursor on > a given stream is attempted to move to a specified row without a > specified column. ...to: > A cursor on a given stream cannot be moved to a specified row without > a specified column. Backport-PR-URL: #17622 PR-URL: #16954 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
@Trott backports for v6.x and v8.x? Feel free to mark don't land if it's a hassle. |
Node.js error codes don't exist in 6.x so marking as dont-land for that version. They exist in 8.x so I'll take a closer look at that... |
Remove the practice of starting most error descriptions with "Used when" or wordier variations. Change errors of the form: > Used when the type of an asynchronous resource is invalid. ...to: > The type of an asynchronous resource was invalid. Change errors of the form: > The `'ERR_INVALID_CURSOR_POS'` is thrown specifically when a cursor on > a given stream is attempted to move to a specified row without a > specified column. ...to: > A cursor on a given stream cannot be moved to a specified row without > a specified column. PR-URL: nodejs#16954 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Remove the practice of starting most error descriptions with "Used when" or wordier variations. Change errors of the form: > Used when the type of an asynchronous resource is invalid. ...to: > The type of an asynchronous resource was invalid. Change errors of the form: > The `'ERR_INVALID_CURSOR_POS'` is thrown specifically when a cursor on > a given stream is attempted to move to a specified row without a > specified column. ...to: > A cursor on a given stream cannot be moved to a specified row without > a specified column. PR-URL: #16954 Backport-PR-URL: #17767 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Remove the practice of starting most error descriptions with "Used when" or wordier variations. Change errors of the form: > Used when the type of an asynchronous resource is invalid. ...to: > The type of an asynchronous resource was invalid. Change errors of the form: > The `'ERR_INVALID_CURSOR_POS'` is thrown specifically when a cursor on > a given stream is attempted to move to a specified row without a > specified column. ...to: > A cursor on a given stream cannot be moved to a specified row without > a specified column. PR-URL: #16954 Backport-PR-URL: #17767 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Remove the practice of starting most error descriptions with "Used when" or wordier variations. Change errors of the form: > Used when the type of an asynchronous resource is invalid. ...to: > The type of an asynchronous resource was invalid. Change errors of the form: > The `'ERR_INVALID_CURSOR_POS'` is thrown specifically when a cursor on > a given stream is attempted to move to a specified row without a > specified column. ...to: > A cursor on a given stream cannot be moved to a specified row without > a specified column. PR-URL: #16954 Backport-PR-URL: #17767 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Remove the practice of starting most error descriptions with "Used when"
or wordier variations.
Change errors of the form:
...to:
Change errors of the form:
...to:
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
errors doc