exceptions.py 991 Bytes
Newer Older
Stelios Karozis's avatar
Stelios Karozis committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
class _JediError(Exception):
    pass


class InternalError(_JediError):
    """
    This error might happen a subprocess is crashing. The reason for this is
    usually broken C code in third party libraries. This is not a very common
    thing and it is safe to use Jedi again. However using the same calls might
    result in the same error again.
    """


class WrongVersion(_JediError):
    """
    This error is reserved for the future, shouldn't really be happening at the
    moment.
    """


class RefactoringError(_JediError):
    """
    Refactorings can fail for various reasons. So if you work with refactorings
    like :meth:`.Script.rename`, :meth:`.Script.inline`,
    :meth:`.Script.extract_variable` and :meth:`.Script.extract_function`, make
    sure to catch these. The descriptions in the errors are ususally valuable
    for end users.

    A typical ``RefactoringError`` would tell the user that inlining is not
    possible if no name is under the cursor.
    """