Translate gcs errors to S3 compatible errors, fixes #4278

master
Remco Verhoef 8 years ago committed by Harshavardhana
parent 909a89647b
commit 07949f68d8
  1. 7
      cmd/gateway-gcs-layer.go

@ -101,6 +101,11 @@ func gcsToObjectError(err error, params ...string) error {
message := googleAPIErr.Errors[0].Message
switch reason {
case "required":
// Anonymous users does not have storage.xyz access to project 123.
fallthrough
case "keyInvalid":
fallthrough
case "forbidden":
err = PrefixAccessDenied{
Bucket: bucket,
@ -237,7 +242,7 @@ func (l *gcsGateway) ListBuckets() ([]BucketInfo, error) {
}
if err != nil {
return []BucketInfo{}, err
return []BucketInfo{}, gcsToObjectError(traceError(err))
}
b = append(b, BucketInfo{

Loading…
Cancel
Save