You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

65 lines
1.3 KiB

  1. from __future__ import unicode_literals
  2. from django.db.utils import DatabaseError
  3. from django.utils.encoding import python_2_unicode_compatible
  4. class AmbiguityError(Exception):
  5. """
  6. Raised when more than one migration matches a name prefix.
  7. """
  8. pass
  9. class BadMigrationError(Exception):
  10. """
  11. Raised when there's a bad migration (unreadable/bad format/etc.).
  12. """
  13. pass
  14. class CircularDependencyError(Exception):
  15. """
  16. Raised when there's an impossible-to-resolve circular dependency.
  17. """
  18. pass
  19. class InvalidBasesError(ValueError):
  20. """
  21. Raised when a model's base classes can't be resolved.
  22. """
  23. pass
  24. class IrreversibleError(RuntimeError):
  25. """
  26. Raised when a irreversible migration is about to be reversed.
  27. """
  28. pass
  29. @python_2_unicode_compatible
  30. class NodeNotFoundError(LookupError):
  31. """
  32. Raised when an attempt on a node is made that is not available in the graph.
  33. """
  34. def __init__(self, message, node):
  35. self.message = message
  36. self.node = node
  37. def __str__(self):
  38. return self.message
  39. def __repr__(self):
  40. return "NodeNotFoundError(%r)" % self.node
  41. class MigrationSchemaMissing(DatabaseError):
  42. pass
  43. class InvalidMigrationPlan(ValueError):
  44. pass