Skip to content

Commit

Permalink
Handle queue attribute error
Browse files Browse the repository at this point in the history
  • Loading branch information
mercury2269 committed Feb 24, 2020
1 parent 3f75882 commit d77cae9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit d77cae9

Please sign in to comment.