/usr/lib/python2.7/dist-packages/pika/exceptions.py is in python-pika 0.9.13-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 | """Pika specific exceptions"""
class AMQPError(Exception):
def __repr__(self):
return 'An unspecified AMQP error has occurred'
class AMQPConnectionError(AMQPError):
def __repr__(self):
if len(self.args) == 1:
if (self.args[0] == 1):
return ('No connection could be opened after 1 '
'connection attempt')
else:
return ('No connection could be opened after %s '
'connection attempts' %
self.args[0])
elif len(self.args) == 2:
return '%s: %s' % (self.args[0], self.args[1])
class IncompatibleProtocolError(AMQPConnectionError):
def __repr__(self):
return 'The protocol returned by the server is not supported'
class AuthenticationError(AMQPConnectionError):
def __repr__(self):
return ('Server and client could not negotiate use of the %s '
'authentication mechanism' % self.args[0])
class ProbableAuthenticationError(AMQPConnectionError):
def __repr__(self):
return ('Client was disconnected at a connection stage indicating a '
'probable authentication error')
class ProbableAccessDeniedError(AMQPConnectionError):
def __repr__(self):
return ('Client was disconnected at a connection stage indicating a '
'probable denial of access to the specified virtual host')
class NoFreeChannels(AMQPConnectionError):
def __repr__(self):
return 'The connection has run out of free channels'
class ConnectionClosed(AMQPConnectionError):
def __repr__(self):
return 'The AMQP connection was closed (%s) %s' % (self.args[0],
self.args[1])
class AMQPChannelError(AMQPError):
def __repr__(self):
return 'An unspecified AMQP channel error has occurred'
class ChannelClosed(AMQPChannelError):
def __repr__(self):
return 'The channel was remotely closed (%s) %s' % (self.args[0],
self.args[1])
class DuplicateConsumerTag(AMQPChannelError):
def __repr__(self):
return ('The consumer tag specified already exists for this '
'channel: %s' % self.args[0])
class ConsumerCancelled(AMQPChannelError):
def __repr__(self):
return 'Server cancelled consumer (%s): %s' % (self.args[0].reply_code,
self.args[0].reply_text)
class InvalidChannelNumber(AMQPError):
def __repr__(self):
return 'An invalid channel number has been specified: %s' % self.args[0]
class ProtocolSyntaxError(AMQPError):
def __repr__(self):
return 'An unspecified protocol syntax error occurred'
class UnexpectedFrameError(ProtocolSyntaxError):
def __repr__(self):
return 'Received a frame out of sequence: %r' % self.args[0]
class ProtocolVersionMismatch(ProtocolSyntaxError):
def __repr__(self):
return 'Protocol versions did not match: %r vs %r' % (self.args[0],
self.args[1])
class BodyTooLongError(ProtocolSyntaxError):
def __repr__(self):
return ('Received too many bytes for a message delivery: '
'Received %i, expected %i' % (self.args[0], self.args[1]))
class InvalidFrameError(ProtocolSyntaxError):
def __repr__(self):
return 'Invalid frame received: %r' % self.args[0]
class InvalidFieldTypeException(ProtocolSyntaxError):
def __repr__(self):
return 'Unsupported field kind %s' % self.args[0]
class UnspportedAMQPFieldException(ProtocolSyntaxError):
def __repr__(self):
return 'Unsupported field kind %s' % type(self.args[1])
class MethodNotImplemented(AMQPError):
pass
class ChannelError(Exception):
def __repr__(self):
return 'An unspecified error occurred with the Channel'
class InvalidMinimumFrameSize(ProtocolSyntaxError):
def __repr__(self):
return 'AMQP Minimum Frame Size is 4096 Bytes'
class InvalidMaximumFrameSize(ProtocolSyntaxError):
def __repr__(self):
return 'AMQP Maximum Frame Size is 131072 Bytes'
|