Skip to content

Exception classes Documentation

Exceptions

RequestError

RequestError(errors: Union[str, List[str]])

Bases: Exception

Raised when there is an error in the request response.

PARAMETER DESCRIPTION
errors

A string or list of strings representing the error(s) encountered during the request.

TYPE: Union[str, List[str]]

RETURNS DESCRIPTION
None

This method doesn't return anything, it initializes the object.

TYPE: None

Source code in AniLinkPy/exceptions.py
def __init__(self, errors: Union[str, List[str]]) -> None:
    """
    Initialize a RequestError instance.

    Args:
        errors (Union[str, List[str]]): A string or list of strings representing the error(s) encountered during the request.

    Returns:
        None: This method doesn't return anything, it initializes the object.
    """
    self.errors = errors
    super().__init__(f"Request Error: {self.errors}")

errors instance-attribute

errors = errors

UnsupportedMethodError

UnsupportedMethodError(method: str)

Bases: Exception

Raised when an unsupported method is provided to the send_request function.

PARAMETER DESCRIPTION
method

The unsupported HTTP method.

TYPE: str

RETURNS DESCRIPTION
None

This method doesn't return anything.

TYPE: None

Source code in AniLinkPy/exceptions.py
def __init__(self, method: str) -> None:
    """Initialize an UnsupportedMethodError exception.

    Args:
        method (str): The unsupported HTTP method.

    Returns:
        None: This method doesn't return anything.
    """
    self.method = method
    super().__init__(f"Unsupported method: {self.method}")

method instance-attribute

method = method