diff options
author | Eli Collins <elic@assurancetechnologies.com> | 2016-11-19 17:20:15 -0500 |
---|---|---|
committer | Eli Collins <elic@assurancetechnologies.com> | 2016-11-19 17:20:15 -0500 |
commit | 8e8cd19d27f8a5df96633f7c11c1c83815c75f38 (patch) | |
tree | 1465dd1991ea347d34c97ef9614835a45fd15dde /passlib/exc.py | |
parent | 003bbda05ba729bda00351d846d12920646f4c81 (diff) | |
download | passlib-8e8cd19d27f8a5df96633f7c11c1c83815c75f38.tar.gz |
passlib.exc: has_backend() now raises explicit UnknownBackendError, not ValueError
Diffstat (limited to 'passlib/exc.py')
-rw-r--r-- | passlib/exc.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/passlib/exc.py b/passlib/exc.py index d044aec..ffb9fe6 100644 --- a/passlib/exc.py +++ b/passlib/exc.py @@ -2,6 +2,19 @@ #============================================================================= # exceptions #============================================================================= +class UnknownBackendError(ValueError): + """ + Error raised if multi-backend handler doesn't recognize backend name. + Inherits from :exc:`ValueError`. + + .. versionadded:: 1.7 + """ + def __init__(self, hasher, backend): + self.hasher = hasher + self.backend = backend + message = "%s: unknown backend: %r" % (hasher.name, backend) + ValueError.__init__(self, message) + class MissingBackendError(RuntimeError): """Error raised if multi-backend handler has no available backends; or if specifically requested backend is not available. |