Exceptions

BaseException

Bases: Exception

The base exception used in the system.

Source code in easy_email/exceptions.py
1
2
3
4
5
6
7
8
class BaseException(Exception):
    """The base exception used in the system."""

    def __init__(self, msg=None):
        # Default message if none is provided
        if msg is None:
            msg = "An error occurred in the system"
        super().__init__(msg)

InvalidEmailProcessor

Bases: BaseException

raises when user use a wrong email processor

Source code in easy_email/exceptions.py
37
38
class InvalidEmailProcessor(BaseException):
    """raises when user use a wrong email processor"""

InvalidFileFormat

Bases: BaseException

Raised when the specified send time is in the past.

Source code in easy_email/exceptions.py
28
29
30
31
32
33
34
class InvalidFileFormat(BaseException):
    """Raised when the specified send time is in the past."""

    def __init__(self, msg=None):
        if not msg:
            msg = "Invalid file format"
        super().__init__(msg)

InvalidSendTime

Bases: BaseException

Raised when the specified send time is in the past.

Source code in easy_email/exceptions.py
19
20
21
22
23
24
25
class InvalidSendTime(BaseException):
    """Raised when the specified send time is in the past."""

    def __init__(self, msg=None):
        if not msg:
            msg = "The specified send time is invalid"
        super().__init__(msg)

TemplateNotFound

Bases: BaseException

The exception raised when a template is not found.

Source code in easy_email/exceptions.py
11
12
13
14
15
16
class TemplateNotFound(BaseException):
    """The exception raised when a template is not found."""

    def __init__(self, template_name=None):
        msg = f"Template '{template_name}' doesn't exist" if template_name else "Template doesn't exist"
        super().__init__(msg)