Skip to content

Commit

Permalink
Correctly name error constant/message
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdnk committed Oct 23, 2024
1 parent 7d7bd59 commit 0946b0a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sqsjobs/item.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const (
BinaryType string = "Binary"
ApproximateReceiveCount string = "ApproximateReceiveCount"
fifoSuffix string = ".fifo"
jobAlreadyStopped string = "Failed to acknowledge the job. The pipeline is probably stopped."
pipelineStoppedError string = "Failed to ACK/NACK the job. The pipeline is probably stopped."
)

var _ jobs.Job = (*Item)(nil)
Expand Down Expand Up @@ -135,7 +135,7 @@ func (i *Item) Context() ([]byte, error) {

func (i *Item) Ack() error {
if atomic.LoadUint64(i.Options.stopped) == 1 {
return errors.Str(jobAlreadyStopped)
return errors.Str(pipelineStoppedError)
}
defer func() {
i.Options.cond.Signal()
Expand Down Expand Up @@ -206,14 +206,14 @@ func commonNack(i *Item) error {

func (i *Item) Nack() error {
if atomic.LoadUint64(i.Options.stopped) == 1 {
return errors.Str(jobAlreadyStopped)
return errors.Str(pipelineStoppedError)
}
return commonNack(i)
}

func (i *Item) NackWithOptions(requeue bool, delay int) error {
if atomic.LoadUint64(i.Options.stopped) == 1 {
return errors.Str(jobAlreadyStopped)
return errors.Str(pipelineStoppedError)
}
if requeue {
// requeue message
Expand All @@ -229,7 +229,7 @@ func (i *Item) NackWithOptions(requeue bool, delay int) error {

func (i *Item) Requeue(headers map[string][]string, delay int) error {
if atomic.LoadUint64(i.Options.stopped) == 1 {
return errors.Str(jobAlreadyStopped)
return errors.Str(pipelineStoppedError)
}

defer func() {
Expand Down

0 comments on commit 0946b0a

Please sign in to comment.