amqpy.exceptions module

AMQP uses exceptions to handle errors:

  • Any operational error (message queue not found, insufficient access rights, etc.) results in a channel exception.
  • Any structural error (invalid argument, bad sequence of methods, etc.) results in a connection exception.

According to the AMQP specification, an exception closes the associated channel or connection, and returns a reply code and reply text to the client. However, amqpy will automatically re-open the channel after a channel error.

exception amqpy.exceptions.Timeout[source]

Bases: TimeoutError

General AMQP operation timeout

exception amqpy.exceptions.ContentTooLarge(reply_text=None, method_type=None, method_name=None, reply_code=None, channel_id=None)[source]

Bases: amqpy.exceptions.RecoverableChannelError

The client attempted to transfer content larger than the server could accept at the present time. The client may retry at a later time.

exception amqpy.exceptions.NoConsumers(reply_text=None, method_type=None, method_name=None, reply_code=None, channel_id=None)[source]

Bases: amqpy.exceptions.RecoverableChannelError

When the exchange cannot deliver to a consumer when the immediate flag is set. As a result of pending data on the queue or the absence of any consumers of the queue.

exception amqpy.exceptions.ConnectionForced(reply_text=None, method_type=None, method_name=None, reply_code=None, channel_id=None)[source]

Bases: amqpy.exceptions.RecoverableConnectionError

An operator intervened to close the connection for some reason. The client may retry at some later date.

exception amqpy.exceptions.InvalidPath(reply_text=None, method_type=None, method_name=None, reply_code=None, channel_id=None)[source]

Bases: amqpy.exceptions.IrrecoverableConnectionError

The client tried to work with an unknown virtual host.

exception amqpy.exceptions.AccessRefused(reply_text=None, method_type=None, method_name=None, reply_code=None, channel_id=None)[source]

Bases: amqpy.exceptions.IrrecoverableChannelError

The client attempted to work with a server entity to which it has no access due to security settings.

exception amqpy.exceptions.NotFound(reply_text=None, method_type=None, method_name=None, reply_code=None, channel_id=None)[source]

Bases: amqpy.exceptions.IrrecoverableChannelError

The client attempted to work with a server entity that does not exist.

exception amqpy.exceptions.ResourceLocked(reply_text=None, method_type=None, method_name=None, reply_code=None, channel_id=None)[source]

Bases: amqpy.exceptions.RecoverableChannelError

The client attempted to work with a server entity to which it has no access because another client is working with it.

exception amqpy.exceptions.PreconditionFailed(reply_text=None, method_type=None, method_name=None, reply_code=None, channel_id=None)[source]

Bases: amqpy.exceptions.IrrecoverableChannelError

The client requested a method that was not allowed because some precondition failed.

exception amqpy.exceptions.FrameError(reply_text=None, method_type=None, method_name=None, reply_code=None, channel_id=None)[source]

Bases: amqpy.exceptions.IrrecoverableConnectionError

The sender sent a malformed frame that the recipient could not decode. This strongly implies a programming error in the sending peer.

exception amqpy.exceptions.FrameSyntaxError(reply_text=None, method_type=None, method_name=None, reply_code=None, channel_id=None)[source]

Bases: amqpy.exceptions.IrrecoverableConnectionError

The sender sent a frame that contained illegal values for one or more fields. This strongly implies a programming error in the sending peer.

exception amqpy.exceptions.InvalidCommand(reply_text=None, method_type=None, method_name=None, reply_code=None, channel_id=None)[source]

Bases: amqpy.exceptions.IrrecoverableConnectionError

The client sent an invalid sequence of frames, attempting to perform an operation that was considered invalid by the server. This usually implies a programming error in the client.

exception amqpy.exceptions.ChannelNotOpen(reply_text=None, method_type=None, method_name=None, reply_code=None, channel_id=None)[source]

Bases: amqpy.exceptions.IrrecoverableConnectionError

The client attempted to work with a channel that had not been correctly opened. This most likely indicates a fault in the client layer.

exception amqpy.exceptions.UnexpectedFrame(reply_text=None, method_type=None, method_name=None, reply_code=None, channel_id=None)[source]

Bases: amqpy.exceptions.IrrecoverableConnectionError

The peer sent a frame that was not expected, usually in the context of a content header and body. This strongly indicates a fault in the peer’s content processing.

exception amqpy.exceptions.ResourceError(reply_text=None, method_type=None, method_name=None, reply_code=None, channel_id=None)[source]

Bases: amqpy.exceptions.RecoverableConnectionError

The server could not complete the method because it lacked sufficient resources. This may be due to the client creating too many of some type of entity.

exception amqpy.exceptions.NotAllowed(reply_text=None, method_type=None, method_name=None, reply_code=None, channel_id=None)[source]

Bases: amqpy.exceptions.IrrecoverableConnectionError

The client tried to work with some entity in a manner that is prohibited by the server, due to security settings or by some other criteria.

exception amqpy.exceptions.AMQPNotImplementedError(reply_text=None, method_type=None, method_name=None, reply_code=None, channel_id=None)[source]

Bases: amqpy.exceptions.IrrecoverableConnectionError

The client tried to use functionality that is not implemented in the server.

exception amqpy.exceptions.InternalError(reply_text=None, method_type=None, method_name=None, reply_code=None, channel_id=None)[source]

Bases: amqpy.exceptions.IrrecoverableConnectionError

The server could not complete the method because of an internal error. The server may require intervention by an operator in order to resume normal operations.