Skip to content

reprexlite.exceptions

Classes

BlackNotFoundError

Bases: ModuleNotFoundError, ReprexliteException

Raised when ipython cannot be found when using a black-dependent feature.

Source code in reprexlite/exceptions.py
5
6
class BlackNotFoundError(ModuleNotFoundError, ReprexliteException):
    """Raised when ipython cannot be found when using a black-dependent feature."""

IPythonNotFoundError

Bases: ModuleNotFoundError, ReprexliteException

Raised when ipython cannot be found when using an IPython-dependent feature.

Source code in reprexlite/exceptions.py
25
26
class IPythonNotFoundError(ModuleNotFoundError, ReprexliteException):
    """Raised when ipython cannot be found when using an IPython-dependent feature."""

InputSyntaxError

Bases: SyntaxError, ReprexliteException

Raised when encountering a syntax error when parsing input.

Source code in reprexlite/exceptions.py
 9
10
class InputSyntaxError(SyntaxError, ReprexliteException):
    """Raised when encountering a syntax error when parsing input."""

NotAFormatterError

Bases: TypeError, ReprexliteException

Raised when registering a formatter that is not a subclass of the Formatter base class.

Source code in reprexlite/exceptions.py
37
38
class NotAFormatterError(TypeError, ReprexliteException):
    """Raised when registering a formatter that is not a subclass of the Formatter base class."""

PygmentsNotFoundError

Bases: ModuleNotFoundError, ReprexliteException

Raised when pygments cannot be found when using a pygments-dependent feature.

Source code in reprexlite/exceptions.py
45
46
class PygmentsNotFoundError(ModuleNotFoundError, ReprexliteException):
    """Raised when pygments cannot be found when using a pygments-dependent feature."""

ReprexliteException

Bases: Exception

Base class for reprexlite exceptions.

Source code in reprexlite/exceptions.py
1
2
class ReprexliteException(Exception):
    """Base class for reprexlite exceptions."""

UnexpectedError

Bases: ReprexliteException

Raised when an unexpected case happens.

Source code in reprexlite/exceptions.py
49
50
51
52
53
54
55
56
57
58
59
class UnexpectedError(ReprexliteException):
    """Raised when an unexpected case happens."""

    def __init__(self, msg: str, *args: object):
        if not msg.endswith(" "):
            msg += " "
        msg += (
            "If you see this error from normal usage, please report at "
            "https://github.com/jayqi/reprexlite/issues"
        )
        super().__init__(msg, *args)