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

Custom error message doesn't get formatted if flavor==CALLABLE #132

Closed
M3t0r opened this issue Mar 9, 2017 · 2 comments
Closed

Custom error message doesn't get formatted if flavor==CALLABLE #132

M3t0r opened this issue Mar 9, 2017 · 2 comments

Comments

@M3t0r
Copy link

M3t0r commented Mar 9, 2017

Schema(lambda i: i == 5, error="Formatstring: {}").validate(12)

produces an exception with the message "Formatstring: {}" and not "Formatstring: 12"

I had to change line 309 to

raise SchemaError('%s(%r) should evaluate to True' % (f, data), e.format(data))

to get it working as intended.

You're also missing the documentation for this feature all together. Took me a while to figure out. And #4 is still open, too.

@sritchie
Copy link

This is still a problem today! I'll send a PR...

@sritchie
Copy link

sritchie commented Jul 15, 2020

Ah, I see it was fixed six days ago. Thank you! a2873bc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants