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

crypto: improve randomInt out-of-range error message #35088

Merged
merged 1 commit into from
Sep 9, 2020

Conversation

Trott
Copy link
Member

@Trott Trott commented Sep 7, 2020

Previously, the crypto.randomInt() message when "max" was less than or
equal to "min" made it sound like the lower bound for "max" was
hard-coded. Make it clear that it is instead dynamic based on the value
of "min".

For crypto.randomInt(10,0):

Before:
RangeError [ERR_OUT_OF_RANGE]: The value of "max" is out of range. It
must be > 10. Received 0

After:

RangeError [ERR_OUT_OF_RANGE]: The value of "max" is out of range. It
must be greater than the value of "min" (10). Received 0

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/crypto

@nodejs-github-bot nodejs-github-bot added the crypto Issues and PRs related to the crypto subsystem. label Sep 7, 2020
@Trott Trott added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 7, 2020
@mscdex
Copy link
Contributor

mscdex commented Sep 7, 2020

s/cryptop/crypto/ in commit message

@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 7, 2020
@nodejs-github-bot

This comment has been minimized.

@Trott
Copy link
Member Author

Trott commented Sep 7, 2020

s/cryptop/crypto/ in commit message

Fixed. Thanks.

@nodejs-github-bot
Copy link
Collaborator

@addaleax addaleax added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 8, 2020
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 8, 2020
@nodejs-github-bot
Copy link
Collaborator

Previously, the crypto.randomInt() message when "max" was less than or
equal to "min" made it sound like the lower bound for "max" was
hard-coded. Make it clear that it is instead dynamic based on the value
of "min".

For crypto.randomInt(10,0):

Before:
RangeError [ERR_OUT_OF_RANGE]: The value of "max" is out of range. It
must be > 10. Received 0

After:

RangeError [ERR_OUT_OF_RANGE]: The value of "max" is out of range. It
must be greater than the value of "min" (10). Received 0

PR-URL: nodejs#35088
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
@Trott
Copy link
Member Author

Trott commented Sep 9, 2020

Landed in d7d0fab

@Trott Trott merged commit d7d0fab into nodejs:master Sep 9, 2020
@Trott Trott deleted the randomInt-msg branch September 9, 2020 14:58
ruyadorno pushed a commit that referenced this pull request Sep 17, 2020
Previously, the crypto.randomInt() message when "max" was less than or
equal to "min" made it sound like the lower bound for "max" was
hard-coded. Make it clear that it is instead dynamic based on the value
of "min".

For crypto.randomInt(10,0):

Before:
RangeError [ERR_OUT_OF_RANGE]: The value of "max" is out of range. It
must be > 10. Received 0

After:

RangeError [ERR_OUT_OF_RANGE]: The value of "max" is out of range. It
must be greater than the value of "min" (10). Received 0

PR-URL: #35088
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
@ruyadorno ruyadorno mentioned this pull request Sep 21, 2020
4 tasks
addaleax pushed a commit that referenced this pull request Sep 22, 2020
Previously, the crypto.randomInt() message when "max" was less than or
equal to "min" made it sound like the lower bound for "max" was
hard-coded. Make it clear that it is instead dynamic based on the value
of "min".

For crypto.randomInt(10,0):

Before:
RangeError [ERR_OUT_OF_RANGE]: The value of "max" is out of range. It
must be > 10. Received 0

After:

RangeError [ERR_OUT_OF_RANGE]: The value of "max" is out of range. It
must be greater than the value of "min" (10). Received 0

PR-URL: #35088
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
@codebytere codebytere mentioned this pull request Sep 28, 2020
joesepi pushed a commit to joesepi/node that referenced this pull request Jan 8, 2021
Previously, the crypto.randomInt() message when "max" was less than or
equal to "min" made it sound like the lower bound for "max" was
hard-coded. Make it clear that it is instead dynamic based on the value
of "min".

For crypto.randomInt(10,0):

Before:
RangeError [ERR_OUT_OF_RANGE]: The value of "max" is out of range. It
must be > 10. Received 0

After:

RangeError [ERR_OUT_OF_RANGE]: The value of "max" is out of range. It
must be greater than the value of "min" (10). Received 0

PR-URL: nodejs#35088
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crypto Issues and PRs related to the crypto subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants