Skip to content

Migration exception

mongorunway.domain.migration_exception ¤

__all__: typing.Sequence[str] = ('MigrationError', 'MigrationFailedError', 'MigrationTransactionFailedError', 'NothingToUpgradeError', 'NothingToDowngradeError', 'MigrationFilesChangedError', 'MigrationFileChangedError') module-attribute ¤

MigrationBusinessRuleBrokenError ¤

Bases: Exception

Source code in mongorunway\domain\migration_exception.py
class MigrationBusinessRuleBrokenError(Exception):
    __slots__ = ("rule",)

    def __init__(self, rule: domain_rule.MigrationBusinessRule) -> None:
        super().__init__(rule.render_broken_rule())
        self.rule = rule

__slots__ = ('rule') instance-attribute class-attribute ¤

rule = rule instance-attribute ¤

__init__(rule) ¤

Source code in mongorunway\domain\migration_exception.py
def __init__(self, rule: domain_rule.MigrationBusinessRule) -> None:
    super().__init__(rule.render_broken_rule())
    self.rule = rule

MigrationError ¤

Bases: Exception

Source code in mongorunway\domain\migration_exception.py
class MigrationError(Exception):
    __slots__: typing.Sequence[str] = ()

    pass

__slots__: typing.Sequence[str] = () instance-attribute class-attribute ¤

MigrationFailedError ¤

Bases: MigrationError

Source code in mongorunway\domain\migration_exception.py
class MigrationFailedError(MigrationError):
    __slots__: typing.Sequence[str] = ()

    pass

__slots__: typing.Sequence[str] = () instance-attribute class-attribute ¤

MigrationFileChangedError ¤

Bases: BaseException

Source code in mongorunway\domain\migration_exception.py
class MigrationFileChangedError(BaseException):
    __slots__: typing.Sequence[str] = (
        "failed_migration_name",
        "failed_migration_version",
    )

    def __init__(self, migration_name: str, migration_version: int) -> None:
        self.failed_migration_name = migration_name
        self.failed_migration_version = migration_version

        super().__init__(
            f"Migration {migration_name!r} with version {migration_version!r} is changed."
        )

__slots__: typing.Sequence[str] = ('failed_migration_name', 'failed_migration_version') instance-attribute class-attribute ¤

failed_migration_name = migration_name instance-attribute ¤

failed_migration_version = migration_version instance-attribute ¤

__init__(migration_name, migration_version) ¤

Source code in mongorunway\domain\migration_exception.py
def __init__(self, migration_name: str, migration_version: int) -> None:
    self.failed_migration_name = migration_name
    self.failed_migration_version = migration_version

    super().__init__(
        f"Migration {migration_name!r} with version {migration_version!r} is changed."
    )

MigrationFilesChangedError ¤

Bases: BaseException

Source code in mongorunway\domain\migration_exception.py
class MigrationFilesChangedError(BaseException):
    __slots__: typing.Sequence[str] = (
        "migration_names",
    )

    def __init__(self, *migration_names: str) -> None:
        self.migration_names = migration_names

        super().__init__(f"{migration_names!r} migrations files have been modified.")

__slots__: typing.Sequence[str] = ('migration_names') instance-attribute class-attribute ¤

migration_names = migration_names instance-attribute ¤

__init__(*migration_names) ¤

Source code in mongorunway\domain\migration_exception.py
def __init__(self, *migration_names: str) -> None:
    self.migration_names = migration_names

    super().__init__(f"{migration_names!r} migrations files have been modified.")

MigrationTransactionFailedError ¤

Bases: MigrationFailedError

Source code in mongorunway\domain\migration_exception.py
class MigrationTransactionFailedError(MigrationFailedError):
    __slots__: typing.Sequence[str] = ("failed_migration",)

    def __init__(self, migration: domain_migration.Migration, /) -> None:
        self.failed_migration = migration

        super().__init__(
            f"Migration {migration.name!r} with version {migration.version!r} is failed."
        )

__slots__: typing.Sequence[str] = ('failed_migration') instance-attribute class-attribute ¤

failed_migration = migration instance-attribute ¤

__init__(migration) ¤

Source code in mongorunway\domain\migration_exception.py
def __init__(self, migration: domain_migration.Migration, /) -> None:
    self.failed_migration = migration

    super().__init__(
        f"Migration {migration.name!r} with version {migration.version!r} is failed."
    )

NothingToDowngradeError ¤

Bases: MigrationFailedError

Source code in mongorunway\domain\migration_exception.py
class NothingToDowngradeError(MigrationFailedError):
    __slots__: typing.Sequence[str] = ()

    def __str__(self) -> str:
        return "There are currently no applied migrations."

__slots__: typing.Sequence[str] = () instance-attribute class-attribute ¤

__str__() ¤

Source code in mongorunway\domain\migration_exception.py
def __str__(self) -> str:
    return "There are currently no applied migrations."

NothingToUpgradeError ¤

Bases: MigrationFailedError

Source code in mongorunway\domain\migration_exception.py
class NothingToUpgradeError(MigrationFailedError):
    __slots__: typing.Sequence[str] = ()

    def __str__(self) -> str:
        return "There are currently no pending migrations."

__slots__: typing.Sequence[str] = () instance-attribute class-attribute ¤

__str__() ¤

Source code in mongorunway\domain\migration_exception.py
def __str__(self) -> str:
    return "There are currently no pending migrations."