Skip to content

Commit

Permalink
Log error code and message for each BatchResultErrorEntry (#23)
Browse files Browse the repository at this point in the history
* Log error code and message for each  BatchResultErrorEntry

* Fix Sprintf formatting
  • Loading branch information
Glen-Moonpig authored Apr 1, 2021
1 parent c595c61 commit d04e24a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,10 @@ func moveMessages(sourceQueueUrl string, destinationQueueUrl string, svc *sqs.SQ
}

if len(sendResp.Failed) > 0 {
log.Error(color.New(color.FgRed).Sprintf("%s messages failed to enqueue, exiting", len(sendResp.Failed)))
log.Error(color.New(color.FgRed).Sprintf("%d messages failed to enqueue, see details below", len(sendResp.Failed)))
for index, failed := range sendResp.Failed {
log.Error(color.New(color.FgRed).Sprintf("%d - (%s) %s", index, *failed.Code, *failed.Message))
}
return
}

Expand Down

0 comments on commit d04e24a

Please sign in to comment.