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

Commits on Sep 9, 2020

  1. crypto: improve randomInt out-of-range error message

    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 committed Sep 9, 2020
    Configuration menu
    Copy the full SHA
    d7d0fab View commit details
    Browse the repository at this point in the history