Source code for term_image.exceptions
"""
.. Custom Exceptions
"""
from __future__ import annotations
[docs]
class TermImageWarning(Warning):
"""Package-specific warning base category."""
[docs]
class TermImageUserWarning(TermImageWarning, UserWarning):
"""Package-specific user warning sub-category."""
[docs]
class TermImageError(Exception):
"""Exception baseclass. Raised for generic errors."""
[docs]
class InvalidSizeError(TermImageError):
"""Raised for invalid sizes."""
[docs]
class RenderError(TermImageError):
"""..."""
[docs]
class StyleError(TermImageError):
"""Raised for errors pertaining to the Style API."""
[docs]
class URLNotFoundError(TermImageError, FileNotFoundError):
"""Raised for 404 errors."""
[docs]
class UrwidImageError(TermImageError):
"""Raised for errors specific to :py:class:`~term_image.widget.UrwidImage`."""