exceptions.py 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. class MemcacheError(Exception):
  2. "Base exception class"
  3. pass
  4. class MemcacheClientError(MemcacheError):
  5. """Raised when memcached fails to parse the arguments to a request, likely
  6. due to a malformed key and/or value, a bug in this library, or a version
  7. mismatch with memcached."""
  8. pass
  9. class MemcacheUnknownCommandError(MemcacheClientError):
  10. """Raised when memcached fails to parse a request, likely due to a bug in
  11. this library or a version mismatch with memcached."""
  12. pass
  13. class MemcacheIllegalInputError(MemcacheClientError):
  14. """Raised when a key or value is not legal for Memcache (see the class docs
  15. for Client for more details)."""
  16. pass
  17. class MemcacheServerError(MemcacheError):
  18. """Raised when memcached reports a failure while processing a request,
  19. likely due to a bug or transient issue in memcached."""
  20. pass
  21. class MemcacheUnknownError(MemcacheError):
  22. """Raised when this library receives a response from memcached that it
  23. cannot parse, likely due to a bug in this library or a version mismatch
  24. with memcached."""
  25. pass
  26. class MemcacheUnexpectedCloseError(MemcacheServerError):
  27. "Raised when the connection with memcached closes unexpectedly."
  28. pass