From d77cae9e60b4723772d8ed5f273931271578a20a Mon Sep 17 00:00:00 2001 From: Sergey Maskalik Date: Sun, 23 Feb 2020 21:22:58 -0800 Subject: [PATCH] Handle queue attribute error --- main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.go b/main.go index 2d68854..838c796 100644 --- a/main.go +++ b/main.go @@ -83,6 +83,11 @@ func main() { AttributeNames: []*string{aws.String("All")}, }) + if err != nil { + logAwsError("Failed to resolve queue attributes", err) + return + } + numberOfMessages, _ := strconv.Atoi(*queueAttributes.Attributes["ApproximateNumberOfMessages"]) log.Info(color.New(color.FgCyan).Sprintf("Approximate number of messages in the source queue: %d", numberOfMessages))