exceptions.py 990 B

12345678910111213141516171819202122232425262728293031
  1. class _JediError(Exception):
  2. pass
  3. class InternalError(_JediError):
  4. """
  5. This error might happen a subprocess is crashing. The reason for this is
  6. usually broken C code in third party libraries. This is not a very common
  7. thing and it is safe to use Jedi again. However using the same calls might
  8. result in the same error again.
  9. """
  10. class WrongVersion(_JediError):
  11. """
  12. This error is reserved for the future, shouldn't really be happening at the
  13. moment.
  14. """
  15. class RefactoringError(_JediError):
  16. """
  17. Refactorings can fail for various reasons. So if you work with refactorings
  18. like :meth:`.Script.rename`, :meth:`.Script.inline`,
  19. :meth:`.Script.extract_variable` and :meth:`.Script.extract_function`, make
  20. sure to catch these. The descriptions in the errors are usually valuable
  21. for end users.
  22. A typical ``RefactoringError`` would tell the user that inlining is not
  23. possible if no name is under the cursor.
  24. """