1 | """ |
---|
2 | Provide exception classes for :mod:`migrate.versioning` |
---|
3 | """ |
---|
4 | |
---|
5 | |
---|
6 | class Error(Exception): |
---|
7 | """Error base class.""" |
---|
8 | pass |
---|
9 | |
---|
10 | |
---|
11 | class ApiError(Error): |
---|
12 | """Base class for API errors.""" |
---|
13 | pass |
---|
14 | |
---|
15 | |
---|
16 | class KnownError(ApiError): |
---|
17 | """A known error condition.""" |
---|
18 | |
---|
19 | |
---|
20 | class UsageError(ApiError): |
---|
21 | """A known error condition where help should be displayed.""" |
---|
22 | |
---|
23 | |
---|
24 | class ControlledSchemaError(Error): |
---|
25 | """Base class for controlled schema errors.""" |
---|
26 | pass |
---|
27 | |
---|
28 | |
---|
29 | class InvalidVersionError(ControlledSchemaError): |
---|
30 | """Invalid version number.""" |
---|
31 | |
---|
32 | |
---|
33 | class DatabaseNotControlledError(ControlledSchemaError): |
---|
34 | """Database should be under version control, but it's not.""" |
---|
35 | |
---|
36 | |
---|
37 | class DatabaseAlreadyControlledError(ControlledSchemaError): |
---|
38 | """Database shouldn't be under version control, but it is""" |
---|
39 | |
---|
40 | |
---|
41 | class WrongRepositoryError(ControlledSchemaError): |
---|
42 | """This database is under version control by another repository.""" |
---|
43 | |
---|
44 | |
---|
45 | class NoSuchTableError(ControlledSchemaError): |
---|
46 | """The table does not exist.""" |
---|
47 | pass |
---|
48 | |
---|
49 | |
---|
50 | class PathError(Error): |
---|
51 | """Base class for path errors.""" |
---|
52 | pass |
---|
53 | |
---|
54 | |
---|
55 | class PathNotFoundError(PathError): |
---|
56 | """A path with no file was required; found a file.""" |
---|
57 | pass |
---|
58 | |
---|
59 | |
---|
60 | class PathFoundError(PathError): |
---|
61 | """A path with a file was required; found no file.""" |
---|
62 | pass |
---|
63 | |
---|
64 | |
---|
65 | class RepositoryError(Error): |
---|
66 | """Base class for repository errors.""" |
---|
67 | pass |
---|
68 | |
---|
69 | |
---|
70 | class InvalidRepositoryError(RepositoryError): |
---|
71 | """Invalid repository error.""" |
---|
72 | pass |
---|
73 | |
---|
74 | |
---|
75 | class ScriptError(Error): |
---|
76 | """Base class for script errors.""" |
---|
77 | pass |
---|
78 | |
---|
79 | |
---|
80 | class InvalidScriptError(ScriptError): |
---|
81 | """Invalid script error.""" |
---|
82 | pass |
---|
83 | |
---|
84 | |
---|
85 | class InvalidVersionError(Error): |
---|
86 | """Invalid version error.""" |
---|
87 | pass |
---|