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

Choice fields should catch LookupError, not just VocabularyRegistryError, when getting a named vocab #55

Closed
jamadden opened this issue Sep 4, 2018 · 0 comments

Comments

@jamadden
Copy link
Member

jamadden commented Sep 4, 2018

LookupError is the documented exception that IVocabularyRegistry.get is supposed to raise. VocabularyRegistryError is a subclass of that used by the specific default implementation. This means that when zope.vocabularyregistry is used, the generic LookupError from zope.component propagates.

Moreover, when Choice does catch VocabularyRegistryError it just raises a plain ValueError, with no indication of the failing field, value, or name. It should raise a ValidationError with the field and value. For backwards compatibility, this should also subclass ValueError and LookupError.

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

No branches or pull requests

1 participant