diff --git a/s3/public.go b/s3/public.go index 16564e9f..ba3695c3 100644 --- a/s3/public.go +++ b/s3/public.go @@ -20,6 +20,8 @@ import ( "github.com/smira/go-aws-auth" ) +const errCodeNotFound = "NotFound" + // PublishedStorage abstract file system with published files (actually hosted on S3) type PublishedStorage struct { s3 *s3.S3 @@ -429,7 +431,7 @@ func (storage *PublishedStorage) FileExists(path string) (bool, error) { _, err := storage.s3.HeadObject(params) if err != nil { aerr, ok := err.(awserr.Error) - if ok && aerr.Code() == s3.ErrCodeNoSuchKey { + if ok && aerr.Code() == errCodeNotFound { return false, nil }