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

errors: improve ERR_INVALID_ARG_TYPE #29675

Closed

Commits on Dec 19, 2019

  1. buffer: improve .from() error details

    This makes sure the original input is passed to the error in case
    no matching inputs are found. Instead of passing along all values,
    only valid or possibliy valid values are passed through. That way
    invalid values end up in the error case with the original input.
    BridgeAR committed Dec 19, 2019
    Copy the full SHA
    c6e586b View commit details
    Browse the repository at this point in the history
  2. errors: improve ERR_INVALID_ARG_TYPE

    ERR_INVALID_ARG_TYPE is the most common error used throughout the
    code base. This improves the error message by providing more details
    to the user and by indicating more precisely which values are allowed
    ones and which ones are not.
    
    It adds the actual input to the error message in case it's a primitive.
    If it's a class instance, it'll print the class name instead of
    "object" and "falsy" or similar entries are not named "type" anymore.
    BridgeAR committed Dec 19, 2019
    Copy the full SHA
    14309b2 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    b033324 View commit details
    Browse the repository at this point in the history
  4. fixup: errors: improve ERR_INVALID_ARG_TYPE

    Linter issue
    BridgeAR committed Dec 19, 2019
    Copy the full SHA
    0e7b9ff View commit details
    Browse the repository at this point in the history