1"""
2<Program Name>
3 exceptions.py
4
5<Author>
6 Geremy Condra
7 Vladimir Diaz <vladimir.v.diaz@gmail.com>
8
9<Started>
10 VD: April 4, 2012 Revision.
11
12<Copyright>
13 See LICENSE for licensing information.
14
15<Purpose>
16 Define exceptions. The names chosen for exception classes should end in
17 'Error' (except where there is a good reason not to).
18"""
19
20
21class Error(Exception):
22 """Indicate a generic error."""
23
24
25class FormatError(Error):
26 """Indicate an error while validating an object's format."""
27
28
29class UnsupportedAlgorithmError(Error):
30 """Indicate an error while trying to identify a user-specified algorithm."""
31
32
33class UnsupportedLibraryError(Error):
34 """Indicate that a supported library could not be located or imported."""
35
36
37class KeyMismatchError(ValueError):
38 """Indicate that a private key does not match the expected public key."""
39
40
41class StorageError(Error):
42 """Indicate an error occured during interaction with an abstracted storage
43 backend."""
44
45
46class UnverifiedSignatureError(Error):
47 """Signature could not be verified: either signature was incorrect or
48 something failed during process (see VerificationError)"""
49
50
51class VerificationError(UnverifiedSignatureError):
52 """Signature could not be verified because something failed in the process"""