Skip to content

Commit

Permalink
Better error messages using ListObjects than using HeadBucket. Might …
Browse files Browse the repository at this point in the history
…be a bigger request but messages are better than BadRequest, how this changes effect the messages are in the issue (#2892)
  • Loading branch information
AndriMar authored and jefferai committed Jun 20, 2017
1 parent 29ef62e commit 17b081c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions physical/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ func newS3Backend(conf map[string]string, logger log.Logger) (Backend, error) {
Region: aws.String(region),
}))

_, err = s3conn.HeadBucket(&s3.HeadBucketInput{Bucket: &bucket})
_, err = s3conn.ListObjects(&s3.ListObjectsInput{Bucket: &bucket})
if err != nil {
return nil, fmt.Errorf("unable to access bucket '%s': %v", bucket, err)
return nil, fmt.Errorf("unable to access bucket '%s' in region %s: %v", bucket, region, err)
}

maxParStr, ok := conf["max_parallel"]
Expand Down

0 comments on commit 17b081c

Please sign in to comment.