Skip to content

Commit

Permalink
Expose ErrDeliveryNotInitialized variable
Browse files Browse the repository at this point in the history
  • Loading branch information
quantumsheep authored and lukebakken committed Sep 4, 2023
1 parent 2eefdf1 commit b3c445f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions delivery.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"time"
)

var errDeliveryNotInitialized = errors.New("delivery not initialized")
var ErrDeliveryNotInitialized = errors.New("delivery not initialized")

// Acknowledger notifies the server of successful or failed consumption of
// deliveries via identifier found in the Delivery.DeliveryTag field.
Expand Down Expand Up @@ -122,7 +122,7 @@ delivery that is not automatically acknowledged.
*/
func (d Delivery) Ack(multiple bool) error {
if d.Acknowledger == nil {
return errDeliveryNotInitialized
return ErrDeliveryNotInitialized
}
return d.Acknowledger.Ack(d.DeliveryTag, multiple)
}
Expand All @@ -142,7 +142,7 @@ delivery that is not automatically acknowledged.
*/
func (d Delivery) Reject(requeue bool) error {
if d.Acknowledger == nil {
return errDeliveryNotInitialized
return ErrDeliveryNotInitialized
}
return d.Acknowledger.Reject(d.DeliveryTag, requeue)
}
Expand All @@ -167,7 +167,7 @@ delivery that is not automatically acknowledged.
*/
func (d Delivery) Nack(multiple, requeue bool) error {
if d.Acknowledger == nil {
return errDeliveryNotInitialized
return ErrDeliveryNotInitialized
}
return d.Acknowledger.Nack(d.DeliveryTag, multiple, requeue)
}

0 comments on commit b3c445f

Please sign in to comment.