Errors¶
All the adapter's sentinels are errors.NewSentinel values from gitlab.com/phpboyscout/go/errors.
Test for them with errors.Is. Each is returned wrapped, with the object or path that failed.
| Sentinel | Code | Returned by | When |
|---|---|---|---|
ErrNoExchange |
messaging_rabbitmq.no_exchange |
Open |
Settings.Exchange does not exist. The passive declare failed; the broker's reason is in the message. |
ErrManagement |
messaging_rabbitmq.management |
Open, Subscribe |
The management API is unreachable or disabled, answered a status of 300 or more other than 404, or answered a body that is not JSON. The message names the path. |
ErrNoQueue |
messaging_rabbitmq.no_queue |
Subscribe |
The queue the subscription resolves to does not exist, found by the passive declare or by a 404 from the management API. |
ErrUnroutable |
messaging_rabbitmq.unroutable |
Publish |
No queue is bound for the subject, so the exchange returned the message. |
ErrClosed |
messaging_rabbitmq.closed |
Publish |
The session is closed. |
Errors without a sentinel¶
These are plain errors, with the text that names the cause:
messaging-rabbitmq: dialling, fromOpen, wrappingamqp.Dial's error.messaging-rabbitmq: encoding the event, fromPublish, wrapping the format's refusal.messaging-rabbitmq: the event's properties encode to N bytes and the negotiated frame size is M, fromPublish.messaging-rabbitmq: the broker refused a publish to "subject" (basic.nack), fromPublish.- The queue refusals from
Subscribe: not a quorum queue, delivery limit too low or not reported, no dead-letter exchange, wrong dead-letter strategy, wrong overflow,MaxProcessingTimetoo close to the consumer timeout, and no binding for the pattern. Each names the queue. See Topology it expects. - Wrapped client errors: opening a channel, setting prefetch, consuming, acknowledging, rejecting, dead-lettering, cancelling.
Core errors it returns¶
| Error | When |
|---|---|
messaging.ErrNotSupported |
Subscribe was given a mode other than AtMostOnce or AtLeastOnce. |
messaging.ErrSettlementRefused |
A handler's outcome arrives after its source was retired. |
Source endings¶
A source that ends because the broker took its consumer away, or its channel closed, closes its
deliveries channel and records the reason as the source's cause: the broker cancelled consumer "tag"
or the channel closed, wrapping the AMQP error. The adapter also logs it at warn level.