-
Notifications
You must be signed in to change notification settings - Fork 218
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
Maybe loses error information #369
Comments
This makes it possible to supply a good error message to the user. This got reported in alecthomas#369
@hynek thanks for reporting this! There is now the ability to set Do you think this change is sufficient for resolving this issue or should we explore further functionality that uses any |
Is there a precedent of such composites bubbling up messages? I think I could live with just setting msg on the Maybe myself. |
@hynek just a quick message to say that a new version of voluptuous was released recently with the above change. |
Thanks for letting me know and for keeping this great library alive! |
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. Change-Id: I03bc182dff90f752a882e5920a034458bd8226b5
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.
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.
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.
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.
One example says more than 1000 words:
I would like to supply a good error message to the user but setting
msg
on Maybe doesn't work and Range's gets ignored.The text was updated successfully, but these errors were encountered: