Errors
Error classes to find errors more accurately.
class Error(Exception)
Generic error.
def __init__(self,
error_type: str = "",
message: str = ""
) -> Noneclass HTTPError(Error)
The API call returned an error.
def __init__(self,
dic: dict # The caught HTTP error will often be returned as a dict
) -> Noneclass ImageError(Exception)
Generic error in terms of the avatar image.
def __init__(self,
message: str = None
) -> Noneclass ImageValueError(ImageError)
The avatar image has a value error.
def __init__(self,
file_name: str = None
) -> Noneclass ImageOSError(ImageError)
The image cannot be written to your device.
def __init__(self,
message: str = None
) -> Noneclass PILError(ImageError)
PIL is not installed or a DAvatar method that uses PIL raised an unexpected error.
def __init__(self,
message: str = "To use this function you need to install Pillow."
) -> Noneclass IncorrectColor(Exception)
The color you provided is not in hex format.
def __init__(self,
wrong_color: str = None
) -> Noneclass InvalidOption(Exception)
The option you provided is not a valid option.
def __init__(self,
wrong_option: str = None
) -> Nonedef log_error()
Manually log an error either printing the error or raising it.
def log_error(
exception: Union[Exception, str],
raise_error: bool = False
) -> NoneRaises: The given
exceptionifraise_erroris set toTrue
Last updated
Was this helpful?