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