-
Notifications
You must be signed in to change notification settings - Fork 219
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
Ensure Maybe propagates error information #411
Conversation
Hmm, it's interesting because the test case now fails in Python 3.x due to: File "/home/travis/build/alecthomas/voluptuous/voluptuous/validators.py", line 589, in __call__
if self.min is not None and not v >= self.min:
TypeError: '>=' not supported between instances of 'NoneType' and 'int' This previously didn't happen as it checked for |
Please see pull request #414 for a potential fix for the incomparable values. It should solve this issue at the very least. My guess is that there probably are other validators that should check for TypeError's as well - e.g. Length comes to mind. |
@svisser The mentioned PR #414 has by now been merged and indeed fixes this issue for me. |
Due to Any evaluating all options, and raising the exception from the first encountered error, Maybe would discard the expected error raised by the provided validator and only raise a invalid value error (due to values not being None). This commit changes the order of the validators in Maybe so that the first evaluated error, and thus returned is that of the provided validator.
This reverts commit da3cc96.
This reverts commit da3cc96.
Due to Any evaluating all options, and raising the exception
from the first encountered error, Maybe would discard the
expected error raised by the provided validator.
This commit changes the order of the validators in Maybe so
that the first evaluated error (and thus returned) is that of
the provided validator.