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

Exception Hierarchies #153

Open
swooster-submitnet opened this issue Nov 12, 2013 · 1 comment
Open

Exception Hierarchies #153

swooster-submitnet opened this issue Nov 12, 2013 · 1 comment

Comments

@swooster-submitnet
Copy link

I'd like to use Colander to validate input into an API, and it'd be useful to differentiate errors without resorting to brittle things like inspecting the error message. Colander appears to support throwing subclasses of Invalid, but I don't see a straightforward way to write a wrapper library that (for example) throws different exceptions for missing values and unknown ones without abusing Colander internals.

Assuming that my managers are fine with me contributing to the Pylons Project, and that I can write a change that Colander's maintainers approve of, is this a feature that fits with plans for Colander?

@tseaver
Copy link
Member

tseaver commented Dec 20, 2013

As long as the new classes derive from Invalid (so that code which does 'except Invalid:' still works), I don't see any reason why such a change would be a problem.

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

2 participants