AWS changed their error interface; fix compile breakage.

This commit is contained in:
Jeff Mitchell 2015-05-21 16:15:21 -04:00
parent 3713ef9fb7
commit bb866b0140

View file

@ -11,6 +11,7 @@ import (
"github.com/armon/go-metrics"
"github.com/awslabs/aws-sdk-go/aws"
"github.com/awslabs/aws-sdk-go/aws/awserr"
"github.com/awslabs/aws-sdk-go/aws/credentials"
"github.com/awslabs/aws-sdk-go/service/s3"
)
@ -101,9 +102,9 @@ func (s *S3Backend) Get(key string) (*Entry, error) {
Key: aws.String(key),
})
if awserr := aws.Error(err); awserr != nil {
if awsErr, ok := err.(awserr.RequestFailure); ok {
// Return nil on 404s, error on anything else
if awserr.StatusCode == 404 {
if awsErr.StatusCode() == 404 {
return nil, nil
} else {
return nil, err