validate bucket before attempting batch replication (#15861)

This commit is contained in:
Harshavardhana
2022-10-15 11:58:31 -07:00
committed by GitHub
parent c79bcc8838
commit c68910005b
5 changed files with 80 additions and 2 deletions

View File

@@ -2228,6 +2228,12 @@ func toAPIError(ctx context.Context, err error) APIError {
// their internal error types. This code is only
// useful with gateway implementations.
switch e := err.(type) {
case batchReplicationJobError:
apiErr = APIError{
Code: e.Code,
Description: e.Description,
HTTPStatusCode: e.HTTPStatusCode,
}
case InvalidArgument:
apiErr = APIError{
Code: "InvalidArgument",