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

Validation checks should throw new ValidationFailed-like, not AssertionError #190

Open
brews opened this issue Mar 31, 2022 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@brews
Copy link
Member

brews commented Mar 31, 2022

At the moment all checks to validate output data are done using assert. It would be great if we could get these to throw a custom error (like ValidationError or some subclass of this) instead.

People often run python can be run with assertions disabled, and this would disable a key behavior in these functions. Worse still is that validation code would still quietly run and "pass" data with no indication that checks are not being performed.

This addition could also make it easier for people to catch and handle certain types of validation problems, with more helpful error messages.

@brews brews added bug Something isn't working help wanted Extra attention is needed labels Mar 31, 2022
@brews brews changed the title Validation checks should throw new ValidationError, not AssertionError Validation checks should throw new ValidationFailed-like, not AssertionError Mar 31, 2022
@brews
Copy link
Member Author

brews commented Mar 31, 2022

I've used ValidationError a couple times, but that also makes me feel like validation is throwing some unexpected error, not that it performed as it should and caught bad data... if that makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant