Skip to content

meringue.thumbnail.exceptions ¤

ThumbnailError ¤

ThumbnailError(
    message: str | None = None, code: str | None = None
)

Bases: Exception

Base thumbnail exception

Attributes:

  • message

    Custom error message.

  • code

    Custom error code.

Source code in meringue/thumbnail/exceptions.py
def __init__(self, message: str | None = None, code: str | None = None):
    """
    Attributes:
        message: Custom error message.
        code: Custom error code.
    """
    self.message = message or self.default_message
    self.code = code or self.default_code
    super().__init__(f"Error `{self.code}`: {self.message}")

WrongPropertyOptionError ¤

WrongPropertyOptionError(
    prop: str,
    option: str,
    message: str | None = None,
    code: str | None = None,
)

Bases: ThumbnailError

Exception wrong property option

Attributes:

  • prop

    The property with the problem.

  • option

    Value with which there was a problem.

  • message

    Custom error message.

  • code

    Custom error code.

Source code in meringue/thumbnail/exceptions.py
def __init__(self, prop: str, option: str, message: str | None = None, code: str | None = None):
    """
    Attributes:
        prop: The property with the problem.
        option: Value with which there was a problem.
        message: Custom error message.
        code: Custom error code.
    """
    message = (message or self.default_message).format(prop=prop, option=option)
    code = code or self.default_code
    super().__init__(message, code)

ActionError ¤

ActionError(
    message: str | None = None, code: str | None = None
)

Bases: ThumbnailError

Action exception

Attributes:

  • message

    Custom error message.

  • code

    Custom error code.

Source code in meringue/thumbnail/exceptions.py
def __init__(self, message: str | None = None, code: str | None = None):
    """
    Attributes:
        message: Custom error message.
        code: Custom error code.
    """
    self.message = message or self.default_message
    self.code = code or self.default_code
    super().__init__(f"Error `{self.code}`: {self.message}")

ThumbnailerError ¤

ThumbnailerError(
    message: str | None = None, code: str | None = None
)

Bases: ThumbnailError

Thumbnailer exception

Attributes:

  • message

    Custom error message.

  • code

    Custom error code.

Source code in meringue/thumbnail/exceptions.py
def __init__(self, message: str | None = None, code: str | None = None):
    """
    Attributes:
        message: Custom error message.
        code: Custom error code.
    """
    self.message = message or self.default_message
    self.code = code or self.default_code
    super().__init__(f"Error `{self.code}`: {self.message}")

WrongActionOrPropertyError ¤

WrongActionOrPropertyError(
    job: str,
    message: str | None = None,
    code: str | None = None,
)

Bases: ThumbnailerError

Wrong action or property exception

Attributes:

  • job

    Action with problem.

  • message

    Custom error message.

  • code

    Custom error code.

Source code in meringue/thumbnail/exceptions.py
def __init__(self, job: str, message: str | None = None, code: str | None = None):
    """
    Attributes:
        job: Action with problem.
        message: Custom error message.
        code: Custom error code.
    """
    message = (message or self.default_message).format(job=job)
    super().__init__(message, code)

WrongFormatError ¤

WrongFormatError(
    out_format: str,
    message: str | None = None,
    code: str | None = None,
)

Bases: ThumbnailerError

Wrong action or property exception

Attributes:

  • out_format

    Problem format.

  • message

    Custom error message.

  • code

    Custom error code.

Source code in meringue/thumbnail/exceptions.py
def __init__(self, out_format: str, message: str | None = None, code: str | None = None):
    """
    Attributes:
        out_format: Problem format.
        message: Custom error message.
        code: Custom error code.
    """
    message = (message or self.default_message).format(out_format=out_format)
    super().__init__(message, code)