-
Notifications
You must be signed in to change notification settings - Fork 215
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
Reference values in error messages. Fixes #4. #17
base: master
Are you sure you want to change the base?
Conversation
@halst: Travis build failed because of the detected test in the readme…
was supposed to fail like
but instead fails like
and it does not matter, and since this comes from a set, I don't know if we can assume something about the order. Could you look at it? I believe this problem was already in current master. I think that the best way to “fix” it is to make Travis ignore the implicit tests from the readme file. If you fix it, ping me if you want me to rebase my PR. Same problem on #18. |
Yes, it's ok that Travis is failing. However, I need to think about this feature. |
I'm just thinking, what if someone wants to use format method on the error message. It would look awkward: Use(int, error='Invalid {}: {{value}}'.format('year')) |
For the removal of line 115: my bad, I shouldn't have remove that one; I'm changing my commit line 125: completely useless, since the exception is caught line 132, and is forgotten afterwards; I've added a comment to reflect that line 127: this one is more difficult to analyse. The exception is caught but re-raised, and the errors get added on line 141.
If we provide an error message without the
But if we provide an error message with a
As you can see, it's getting reported twice. For real errors messages, it's probably not what we want, as it requires modification afterwards. The fact is that in the previous case (without Note that it is always possible to have both reports, with
So what this removal of |
Absolutely. I don't know how to improve that however. Not sure that it would be done a lot though. In some cases, it could be better to catch the exception, since the
An other idea could be to detect if the error argument is callable, and in that case call it with the value… |
Could you take a look at #107 as well? I think it relates closely to this PR. |
No description provided.