Skip to content

# pamqp.exceptions

## `pamqp.exceptions`

### `PAMQPException`

Bases: `Exception`

Base exception for all pamqp specific exceptions.

Source code in `pamqp/exceptions.py`

    4
    5

    class PAMQPException(Exception):
        """Base exception for all pamqp specific exceptions."""

### `UnmarshalingException`

Bases: `PAMQPException`

Raised when a frame is not able to be unmarshaled.

Source code in `pamqp/exceptions.py`

     8
     9
    10
    11
    12

    class UnmarshalingException(PAMQPException):
        """Raised when a frame is not able to be unmarshaled."""

        def __str__(self) -> str:  # pragma: nocover
            return f'Could not unmarshal {self.args[0]} frame: {self.args[1]}'

### `AMQPError`

Bases: `PAMQPException`

Base exception for all AMQP errors.

Source code in `pamqp/exceptions.py`

    15
    16

    class AMQPError(PAMQPException):
        """Base exception for all AMQP errors."""

### `AMQPSoftError`

Bases: `AMQPError`

Base exception for all AMQP soft errors.

Source code in `pamqp/exceptions.py`

    19
    20

    class AMQPSoftError(AMQPError):
        """Base exception for all AMQP soft errors."""

### `AMQPHardError`

Bases: `AMQPError`

Base exception for all AMQP hard errors.

Source code in `pamqp/exceptions.py`

    23
    24

    class AMQPHardError(AMQPError):
        """Base exception for all AMQP hard errors."""

### `AMQPContentTooLarge`

Bases: `AMQPSoftError`

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

Source code in `pamqp/exceptions.py`

    27
    28
    29
    30
    31
    32
    33
    34
    35

    class AMQPContentTooLarge(AMQPSoftError):
        """
        The client attempted to transfer content larger than the server could
        accept at the present time. The client may retry at a later time.

        """

        name = 'CONTENT-TOO-LARGE'
        value = 311

### `AMQPNoRoute`

Bases: `AMQPSoftError`

Returned when RabbitMQ sends back with 'basic.return' when a 'mandatory' message cannot be delivered to any queue.

Source code in `pamqp/exceptions.py`

    38
    39
    40
    41
    42
    43
    44
    45
    46

    class AMQPNoRoute(AMQPSoftError):
        """
        Returned when RabbitMQ sends back with 'basic.return' when a 'mandatory'
        message cannot be delivered to any queue.

        """

        name = 'NO-ROUTE'
        value = 312

### `AMQPNoConsumers`

Bases: `AMQPSoftError`

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.

Source code in `pamqp/exceptions.py`

    49
    50
    51
    52
    53
    54
    55
    56
    57
    58

    class AMQPNoConsumers(AMQPSoftError):
        """
        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.

        """

        name = 'NO-CONSUMERS'
        value = 313

### `AMQPAccessRefused`

Bases: `AMQPSoftError`

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

Source code in `pamqp/exceptions.py`

    61
    62
    63
    64
    65
    66
    67
    68
    69

    class AMQPAccessRefused(AMQPSoftError):
        """
        The client attempted to work with a server entity to which it has no access
        due to security settings.

        """

        name = 'ACCESS-REFUSED'
        value = 403

### `AMQPNotFound`

Bases: `AMQPSoftError`

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

Source code in `pamqp/exceptions.py`

    72
    73
    74
    75
    76
    77
    78
    79

    class AMQPNotFound(AMQPSoftError):
        """
        The client attempted to work with a server entity that does not exist.

        """

        name = 'NOT-FOUND'
        value = 404

### `AMQPResourceLocked`

Bases: `AMQPSoftError`

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

Source code in `pamqp/exceptions.py`

    82
    83
    84
    85
    86
    87
    88
    89
    90

    class AMQPResourceLocked(AMQPSoftError):
        """
        The client attempted to work with a server entity to which it has no access
        because another client is working with it.

        """

        name = 'RESOURCE-LOCKED'
        value = 405

### `AMQPPreconditionFailed`

Bases: `AMQPSoftError`

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

Source code in `pamqp/exceptions.py`

     93
     94
     95
     96
     97
     98
     99
    100
    101

    class AMQPPreconditionFailed(AMQPSoftError):
        """
        The client requested a method that was not allowed because some
        precondition failed.

        """

        name = 'PRECONDITION-FAILED'
        value = 406

### `AMQPConnectionForced`

Bases: `AMQPHardError`

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

Source code in `pamqp/exceptions.py`

    104
    105
    106
    107
    108
    109
    110
    111
    112

    class AMQPConnectionForced(AMQPHardError):
        """
        An operator intervened to close the connection for some reason. The client
        may retry at some later date.

        """

        name = 'CONNECTION-FORCED'
        value = 320

### `AMQPInvalidPath`

Bases: `AMQPHardError`

The client tried to work with an unknown virtual host.

Source code in `pamqp/exceptions.py`

    115
    116
    117
    118
    119
    120
    121
    122

    class AMQPInvalidPath(AMQPHardError):
        """
        The client tried to work with an unknown virtual host.

        """

        name = 'INVALID-PATH'
        value = 402

### `AMQPFrameError`

Bases: `AMQPHardError`

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

Source code in `pamqp/exceptions.py`

    125
    126
    127
    128
    129
    130
    131
    132
    133

    class AMQPFrameError(AMQPHardError):
        """
        The sender sent a malformed frame that the recipient could not decode. This
        strongly implies a programming error in the sending peer.

        """

        name = 'FRAME-ERROR'
        value = 501

### `AMQPSyntaxError`

Bases: `AMQPHardError`

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

Source code in `pamqp/exceptions.py`

    136
    137
    138
    139
    140
    141
    142
    143
    144

    class AMQPSyntaxError(AMQPHardError):
        """
        The sender sent a frame that contained illegal values for one or more
        fields. This strongly implies a programming error in the sending peer.

        """

        name = 'SYNTAX-ERROR'
        value = 502

### `AMQPCommandInvalid`

Bases: `AMQPHardError`

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.

Source code in `pamqp/exceptions.py`

    147
    148
    149
    150
    151
    152
    153
    154
    155
    156

    class AMQPCommandInvalid(AMQPHardError):
        """
        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.

        """

        name = 'COMMAND-INVALID'
        value = 503

### `AMQPChannelError`

Bases: `AMQPHardError`

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

Source code in `pamqp/exceptions.py`

    159
    160
    161
    162
    163
    164
    165
    166
    167

    class AMQPChannelError(AMQPHardError):
        """
        The client attempted to work with a channel that had not been correctly
        opened. This most likely indicates a fault in the client layer.

        """

        name = 'CHANNEL-ERROR'
        value = 504

### `AMQPUnexpectedFrame`

Bases: `AMQPHardError`

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.

Source code in `pamqp/exceptions.py`

    170
    171
    172
    173
    174
    175
    176
    177
    178
    179

    class AMQPUnexpectedFrame(AMQPHardError):
        """
        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.

        """

        name = 'UNEXPECTED-FRAME'
        value = 505

### `AMQPResourceError`

Bases: `AMQPHardError`

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.

Source code in `pamqp/exceptions.py`

    182
    183
    184
    185
    186
    187
    188
    189
    190
    191

    class AMQPResourceError(AMQPHardError):
        """
        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.

        """

        name = 'RESOURCE-ERROR'
        value = 506

### `AMQPNotAllowed`

Bases: `AMQPHardError`

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.

Source code in `pamqp/exceptions.py`

    194
    195
    196
    197
    198
    199
    200
    201
    202

    class AMQPNotAllowed(AMQPHardError):
        """
        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.

        """

        name = 'NOT-ALLOWED'
        value = 530

### `AMQPNotImplemented`

Bases: `AMQPHardError`

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

Source code in `pamqp/exceptions.py`

    205
    206
    207
    208
    209
    210
    211
    212
    213

    class AMQPNotImplemented(AMQPHardError):
        """
        The client tried to use functionality that is not implemented in the
        server.

        """

        name = 'NOT-IMPLEMENTED'
        value = 540

### `AMQPInternalError`

Bases: `AMQPHardError`

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.

Source code in `pamqp/exceptions.py`

    216
    217
    218
    219
    220
    221
    222
    223
    224
    225

    class AMQPInternalError(AMQPHardError):
        """
        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.

        """

        name = 'INTERNAL-ERROR'
        value = 541