From d04e24a909c788b50a92fb42b65046c410eb29ad Mon Sep 17 00:00:00 2001 From: Glen Thomas Date: Thu, 1 Apr 2021 18:30:45 +0100 Subject: [PATCH] Log error code and message for each BatchResultErrorEntry (#23) * Log error code and message for each BatchResultErrorEntry * Fix Sprintf formatting --- main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 94360ef..0a2352f 100644 --- a/main.go +++ b/main.go @@ -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 }