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

Values for --unhandled-rejection flag added in v15 are not in --help (and default value is not indicated) #37896

Closed
glasser opened this issue Mar 24, 2021 · 3 comments · Fixed by #37899

Comments

@glasser
Copy link
Contributor

glasser commented Mar 24, 2021

  • Version: v15.12.0 (issue exists on main and has existed since v15.0.0)
  • Platform: Darwin dsg-mbp 18.7.0 Darwin Kernel Version 18.7.0: Tue Nov 10 00:07:31 PST 2020; root:xnu-4903.278.51~1/RELEASE_X86_64 x86_64 (but issue is not platform-specific)
  • Subsystem: src/node_options.cc

What steps will reproduce the bug?

In #33475, @dfabulich added two new legal values for --unhandled-rejection: throw and warn-with-error-code. These new values are not listed in the help string in node --help. Additionally, the help string doesn't explain which is the default value.

$ node --version
v15.12.0
$ node --help | grep -A4 unhandled-rejections
  --unhandled-rejections=...  define unhandled rejections behavior.
  Options are 'strict' (raise an error),
  'warn' (enforce warnings) or 'none'
  (silence warnings)
  --use-bundled-ca            use bundled CA store (default)
$ node --unhandled-rejections=an-unknown-value -e ''
node: invalid value for --unhandled-rejections
$ node --unhandled-rejections=throw -e ''
$ node --unhandled-rejections=warn-with-error-code -e ''

How often does it reproduce? Is there a required condition?

Always.

What is the expected behavior?

The documentation of --unhandled-rejections in --help should list all legal values or not attempt to provide a list of legal values, and it should say what the default value is.

What do you see instead?

Only strict, warn, and none, as shown above.

Additional information

I'd file a PR but I'm not sure I know how to describe the two new values in a concise way. (One option would be to remove the parenthesized explanations and just link to the docs for more details.)

@aduh95
Copy link
Contributor

aduh95 commented Mar 24, 2021

Maybe we could reuse the wording in the documentation: https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode
That'd be awesome if you could make a PR to fix that.

@dfabulich
Copy link
Contributor

There's not gonna be a three-word explanation of throw. Here's my attempt:

Options are 'strict' (always raise an error), 'throw' (raise an error unless 'unhandledRejection' hook is set; this is the default), 'warn' (log a warning), 'none' (silence warnings), 'warn-with-error-code' (log a warning and set exit code 1 unless 'unhandledRejection' hook is set)

glasser added a commit to glasser/node that referenced this issue Mar 24, 2021
These values were added in v15.0.0 by nodejs#33475 but were not included in the
`node --help` output.

Also document which value is the default.

Fixes nodejs#37896.
@glasser
Copy link
Contributor Author

glasser commented Mar 24, 2021

Thanks. I've filed #37899 with @dfabulich's text.

@aduh95 aduh95 linked a pull request Mar 25, 2021 that will close this issue
glasser added a commit to glasser/node that referenced this issue Mar 25, 2021
These values were added in v15.0.0 by nodejs#33475 but were not included in the
`node --help` output.

Also document which value is the default.

Fixes nodejs#37896.
@aduh95 aduh95 closed this as completed in ce6d756 Mar 28, 2021
ruyadorno pushed a commit that referenced this issue Mar 29, 2021
These values were added in v15.0.0 by #33475 but were not included in
the `node --help` output.

Also documents which value is the default.

PR-URL: #37899
Fixes: #37896
Refs: #33475
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
ruyadorno pushed a commit that referenced this issue Mar 30, 2021
These values were added in v15.0.0 by #33475 but were not included in
the `node --help` output.

Also documents which value is the default.

PR-URL: #37899
Fixes: #37896
Refs: #33475
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
targos pushed a commit that referenced this issue May 1, 2021
These values were added in v15.0.0 by #33475 but were not included in
the `node --help` output.

Also documents which value is the default.

PR-URL: #37899
Fixes: #37896
Refs: #33475
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants