Skip to content

Errors

Custom Exceptions for Ramifice.

DoesNotMatchRegexError

Bases: RamificeException

Exception raised if does not match the regular expression.

Parameters:

Name Type Description Default
regex_str str

regular expression in string representation

required
Source code in src\ramifice\utils\errors.py
class DoesNotMatchRegexError(RamificeException):
    """Exception raised if does not match the regular expression.

    Args:
        regex_str: regular expression in string representation
    """

    def __init__(self, regex_str: str) -> None:  # noqa: D107
        self.message = f"Does not match the regular expression: {regex_str}"
        super().__init__(self.message)

FileHasNoExtensionError

Bases: RamificeException

Exception raised if the file has no extension.

Parameters:

Name Type Description Default
message str

explanation of the error

'File has no extension!'
Source code in src\ramifice\utils\errors.py
class FileHasNoExtensionError(RamificeException):
    """Exception raised if the file has no extension.

    Args:
        message: explanation of the error
    """

    def __init__(self, message: str = "File has no extension!") -> None:  # noqa: D107
        self.message = message
        super().__init__(self.message)

ForbiddenDeleteDocError

Bases: RamificeException

Exception is raised when trying to delete the document.

Parameters:

Name Type Description Default
message str

explanation of the error

required
Source code in src\ramifice\utils\errors.py
class ForbiddenDeleteDocError(RamificeException):
    """Exception is raised when trying to delete the document.

    Args:
        message: explanation of the error
    """

    def __init__(self, message: str) -> None:  # noqa: D107
        self.message = message
        super().__init__(self.message)

NoModelsForMigrationError

Bases: RamificeException

Exception raised if no Models for migration.

Source code in src\ramifice\utils\errors.py
class NoModelsForMigrationError(RamificeException):
    """Exception raised if no Models for migration."""

    def __init__(self) -> None:  # noqa: D107
        self.message = "No Models for Migration!"
        super().__init__(self.message)

NotPossibleAddUnitError

Bases: RamificeException

Exception is raised when not possible to add Unit.

Parameters:

Name Type Description Default
message str

explanation of the error

required
Source code in src\ramifice\utils\errors.py
class NotPossibleAddUnitError(RamificeException):
    """Exception is raised when not possible to add Unit.

    Args:
        message: explanation of the error
    """

    def __init__(self, message: str) -> None:  # noqa: D107
        self.message = message
        super().__init__(self.message)

NotPossibleDeleteUnitError

Bases: RamificeException

Exception is raised when not possible to delete Unit.

Parameters:

Name Type Description Default
message str

explanation of the error

required
Source code in src\ramifice\utils\errors.py
class NotPossibleDeleteUnitError(RamificeException):
    """Exception is raised when not possible to delete Unit.

    Args:
        message: explanation of the error
    """

    def __init__(self, message: str) -> None:  # noqa: D107
        self.message = message
        super().__init__(self.message)

OldPassNotMatchError

Bases: RamificeException

Exception is raised when trying to update the password.

Hint: If old password does not match.

Source code in src\ramifice\utils\errors.py
class OldPassNotMatchError(RamificeException):
    """Exception is raised when trying to update the password.

    Hint: If old password does not match.
    """

    def __init__(self) -> None:  # noqa: D107
        self.message = "Old password does not match!"
        super().__init__(self.message)

PanicError

Bases: RamificeException

Exception raised for cases of which should not be.

Parameters:

Name Type Description Default
message str

explanation of the error

required
Source code in src\ramifice\utils\errors.py
class PanicError(RamificeException):
    """Exception raised for cases of which should not be.

    Args:
        message: explanation of the error
    """

    def __init__(self, message: str) -> None:  # noqa: D107
        self.message = message
        super().__init__(self.message)

RamificeException

Bases: Exception

Root Exception for Ramifice.

Source code in src\ramifice\utils\errors.py
class RamificeException(Exception):
    """Root Exception for Ramifice."""

    def __init__(self, *args, **kwargs) -> None:  # type: ignore[no-untyped-def] # noqa: D107
        super().__init__(*args, **kwargs)