fix: error handling cases in site-replication (#13901)

- Allow proper SRError to be propagated to
  handlers and converted appropriately.

- Make sure to enable object locking on buckets
  when requested in MakeBucketHook.

- When DNSConfig is enabled attempt to delete it
  first before deleting buckets locally.
This commit is contained in:
Harshavardhana
2021-12-14 14:09:57 -08:00
committed by GitHub
parent a8d4042853
commit 88ad742da0
5 changed files with 156 additions and 105 deletions

View File

@@ -86,6 +86,8 @@ func toAdminAPIErr(ctx context.Context, err error) APIError {
Description: e.Message,
HTTPStatusCode: e.StatusCode,
}
case SRError:
apiErr = errorCodes.ToAPIErrWithErr(e.Code, e.Cause)
default:
switch {
case errors.Is(err, errConfigNotFound):