Custom Exceptions

The term_image.exceptions module defines the following:

exception term_image.exceptions.TermImageError

Bases: Exception

Exception baseclass. Raised for generic errors.

exception term_image.exceptions.TermImageException

Bases: term_image.exceptions.TermImageError

Deprecated since version 0.4.0: Replaced by TermImageError.

exception term_image.exceptions.URLNotFoundError

Bases: FileNotFoundError, term_image.exceptions.TermImageError

Raised for 404 errors.

exception term_image.exceptions.InvalidSizeError

Bases: ValueError, term_image.exceptions.TermImageError

Raised for invalid image sizes.

exception term_image.exceptions.InvalidSize

Bases: term_image.exceptions.InvalidSizeError

Deprecated since version 0.4.0: Replaced by InvalidSizeError.

exception term_image.exceptions.StyleError

Bases: term_image.exceptions.TermImageError

Baseclass of style-specific exceptions.

Never raised for errors pertaining to image classes defined in this package. Instead, the exception subclass specific to each image class is raised.

Only raised for subclasses of BaseImage defined outside this package (which are not subclasses of any other image class defined in this package).

Being the baseclass of all style-specific exceptions, it can be used be used to handle any style-specific error, regardless of the render style it originated from.

exception term_image.exceptions.GraphicsImageError

Bases: term_image.exceptions.StyleError

Raised for errors specific to GraphicsImage and its subclasses defined outside this package.

exception term_image.exceptions.TextImageError

Bases: term_image.exceptions.StyleError

Raised for errors specific to TextImage and its subclasses defined outside this package.

exception term_image.exceptions.BlockImageError

Bases: term_image.exceptions.TextImageError

Raised for errors specific to BlockImage and its subclasses defined outside this package.

exception term_image.exceptions.ITerm2ImageError

Bases: term_image.exceptions.GraphicsImageError

Raised for errors specific to ITerm2Image and its subclasses defined outside this package.

exception term_image.exceptions.KittyImageError

Bases: term_image.exceptions.GraphicsImageError

Raised for errors specific to KittyImage and its subclasses defined outside this package.