Skip to content

Commit

Permalink
cmd/awstester/wrk: log error type
Browse files Browse the repository at this point in the history
Signed-off-by: Gyuho Lee <[email protected]>
  • Loading branch information
gyuho committed Oct 25, 2018
1 parent 53018c2 commit 4ea65de
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/awstester/wrk/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"net/http"
"os"
"path/filepath"
"reflect"
"regexp"
"strings"
"time"
Expand Down Expand Up @@ -226,7 +227,8 @@ func (up *uploader) upload(localPath, s3Path string) error {
break
}

if aerr, ok := err.(awserr.Error); ok {
aerr, ok := err.(awserr.Error)
if ok {
up.lg.Warn("failed to upload",
zap.String("bucket", bucket),
zap.String("local-path", localPath),
Expand All @@ -241,6 +243,7 @@ func (up *uploader) upload(localPath, s3Path string) error {
zap.String("local-path", localPath),
zap.String("remote-path", s3Path),
zap.String("size", humanize.Bytes(uint64(len(d)))),
zap.String("error-type", fmt.Sprintf("%v", reflect.TypeOf(err))),
zap.Error(err),
)
}
Expand Down

0 comments on commit 4ea65de

Please sign in to comment.