Support unknown gateway errors and convert at handler layer (#7219)

Different gateway implementations due to different backend
API errors, might return different unsupported errors at
our handler layer. Current code posed a problem for us because
this information was lost and we would convert it to InternalError
in this situation all S3 clients end up retrying the request.

To avoid this unexpected situation implement a way to support
this cleanly such that the underlying information is not lost
which is returned by gateway.
This commit is contained in:
Harshavardhana
2019-02-12 01:25:52 -08:00
committed by Nitish Tiwari
parent 9f87283cd5
commit fef5416b3c
29 changed files with 677 additions and 779 deletions

View File

@@ -324,8 +324,6 @@ func gcsToObjectError(err error, params ...string) error {
break
}
err = minio.BucketNotEmpty{Bucket: bucket}
default:
err = fmt.Errorf("Unsupported error reason: %s", reason)
}
return err

View File

@@ -375,15 +375,6 @@ func TestGCSToObjectError(t *testing.T) {
Object: "object",
},
},
{
[]string{"bucket", "object"},
&googleapi.Error{
Errors: []googleapi.ErrorItem{{
Reason: "unknown",
}},
},
fmt.Errorf("Unsupported error reason: unknown"),
},
}
for i, testCase := range testCases {