Coverage for /Users/davegaeddert/Development/dropseed/plain/plain-models/plain/models/migrations/exceptions.py: 81%
26 statements
« prev ^ index » next coverage.py v7.6.1, created at 2024-10-16 22:03 -0500
« prev ^ index » next coverage.py v7.6.1, created at 2024-10-16 22:03 -0500
1from plain.models.db import DatabaseError
4class AmbiguityError(Exception):
5 """More than one migration matches a name prefix."""
7 pass
10class BadMigrationError(Exception):
11 """There's a bad migration (unreadable/bad format/etc.)."""
13 pass
16class CircularDependencyError(Exception):
17 """There's an impossible-to-resolve circular dependency."""
19 pass
22class InconsistentMigrationHistory(Exception):
23 """An applied migration has some of its dependencies not applied."""
25 pass
28class InvalidBasesError(ValueError):
29 """A model's base classes can't be resolved."""
31 pass
34class IrreversibleError(RuntimeError):
35 """An irreversible migration is about to be reversed."""
37 pass
40class NodeNotFoundError(LookupError):
41 """An attempt on a node is made that is not available in the graph."""
43 def __init__(self, message, node, origin=None):
44 self.message = message
45 self.origin = origin
46 self.node = node
48 def __str__(self):
49 return self.message
51 def __repr__(self):
52 return f"NodeNotFoundError({self.node!r})"
55class MigrationSchemaMissing(DatabaseError):
56 pass
59class InvalidMigrationPlan(ValueError):
60 pass