Skip to content

Commit

Permalink
Fix cast review comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rudd-O committed Oct 10, 2017
1 parent 0f13224 commit 7a01a51
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ var times = flag.Int("config.scrape-times", 0, "how many times to scrape before
func logError(err error) {
if err != nil {
if aerr, ok := err.(awserr.Error); ok {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
switch aerr.Code() {
case ecs.ErrCodeServerException:
log.Println(ecs.ErrCodeServerException, aerr.Error())
Expand All @@ -51,8 +53,6 @@ func logError(err error) {
log.Println(aerr.Error())
}
} else {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
log.Println(err.Error())
}
}
Expand Down

0 comments on commit 7a01a51

Please sign in to comment.