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

ArgumentHandler: Support Custom Validation Errors #156

Merged
merged 20 commits into from
Dec 6, 2024

Conversation

ric-evans
Copy link
Member

@ric-evans ric-evans commented Dec 6, 2024

type-Validation

    Many types of validation exceptions are also handled and returned
    as `400 Bad Request` responses if the `type` parameter is a callable
    that raises an exception.
        > HOWEVER, to include a custom validation message in the
          `400 Bad Request` response, you must raise an
          `argparse.ArgumentTypeError(...)`. Otherwise, the
          `400 Bad Request` response will contain a generic
          message, such as 'argument myarg: invalid type'.

`ArgumentHandler`: Support Custom Validation Errors
@ric-evans ric-evans added the enhancement New feature or request label Dec 6, 2024
@ric-evans ric-evans self-assigned this Dec 6, 2024
@ric-evans ric-evans marked this pull request as ready for review December 6, 2024 21:49
@ric-evans ric-evans merged commit b4b1210 into master Dec 6, 2024
28 checks passed
@ric-evans ric-evans deleted the arghandler-errors branch December 6, 2024 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant