Skip to content

Exceptions Documentation

app.exceptions.exception

Bases: Exception

Exception raised when playlist link is not valid.

This exception is raised when the provided YouTube playlist link is incorrect, inaccessible, or does not follow the expected format.

Parameters:

Name Type Description Default
message str

Explanation of the error. Defaults to None.

None

Raises:

Type Description
InvalidYoutubePlaylistLink

When the playlist URL is not valid.

Example

raise InvalidYoutubePlaylistLink("The provided URL is not a valid YouTube playlist link")

Source code in app/exceptions/exception.py
class InvalidYoutubePlaylistLink(Exception):
    """Exception raised when playlist link is not valid.

    This exception is raised when the provided YouTube playlist link is incorrect,
    inaccessible, or does not follow the expected format.

    Args:
        message (str, optional): Explanation of the error. Defaults to None.

    Raises:
        InvalidYoutubePlaylistLink: When the playlist URL is not valid.

    Example:
        >>> raise InvalidYoutubePlaylistLink("The provided URL is not a valid YouTube playlist link")
    """

    def __init__(self, message=None):
        """Initialize the InvalidYoutubePlaylistLink exception.

        Args:
            message (str, optional): Custom error message explaining why the playlist link is invalid.
                Defaults to None.
        """
        super().__init__(message)

__init__(message=None)

Initialize the InvalidYoutubePlaylistLink exception.

Parameters:

Name Type Description Default
message str

Custom error message explaining why the playlist link is invalid. Defaults to None.

None
Source code in app/exceptions/exception.py
def __init__(self, message=None):
    """Initialize the InvalidYoutubePlaylistLink exception.

    Args:
        message (str, optional): Custom error message explaining why the playlist link is invalid.
            Defaults to None.
    """
    super().__init__(message)