Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

exceptions.py 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. """
  2. kombu.exceptions
  3. ================
  4. Exceptions.
  5. """
  6. from __future__ import absolute_import
  7. import socket
  8. from amqp import ChannelError, ConnectionError, ResourceError
  9. __all__ = ['NotBoundError', 'MessageStateError', 'TimeoutError',
  10. 'LimitExceeded', 'ConnectionLimitExceeded',
  11. 'ChannelLimitExceeded', 'ConnectionError', 'ChannelError',
  12. 'VersionMismatch', 'SerializerNotInstalled', 'ResourceError',
  13. 'SerializationError', 'EncodeError', 'DecodeError']
  14. TimeoutError = socket.timeout
  15. class KombuError(Exception):
  16. """Common subclass for all Kombu exceptions."""
  17. pass
  18. class SerializationError(KombuError):
  19. """Failed to serialize/deserialize content."""
  20. class EncodeError(SerializationError):
  21. """Cannot encode object."""
  22. pass
  23. class DecodeError(SerializationError):
  24. """Cannot decode object."""
  25. class NotBoundError(KombuError):
  26. """Trying to call channel dependent method on unbound entity."""
  27. pass
  28. class MessageStateError(KombuError):
  29. """The message has already been acknowledged."""
  30. pass
  31. class LimitExceeded(KombuError):
  32. """Limit exceeded."""
  33. pass
  34. class ConnectionLimitExceeded(LimitExceeded):
  35. """Maximum number of simultaneous connections exceeded."""
  36. pass
  37. class ChannelLimitExceeded(LimitExceeded):
  38. """Maximum number of simultaneous channels exceeded."""
  39. pass
  40. class VersionMismatch(KombuError):
  41. pass
  42. class SerializerNotInstalled(KombuError):
  43. """Support for the requested serialization type is not installed"""
  44. pass
  45. class ContentDisallowed(SerializerNotInstalled):
  46. """Consumer does not allow this content-type."""
  47. pass
  48. class InconsistencyError(ConnectionError):
  49. """Data or environment has been found to be inconsistent,
  50. depending on the cause it may be possible to retry the operation."""
  51. pass