cleanup site replication error handling (#15113)

site replication errors were printed at
various random locations, repeatedly - this
PR attempts to remove double logging and
capture all of them at a common place.

This PR also enhances the code to show
partial success and errors as well.
This commit is contained in:
Harshavardhana
2022-06-20 10:48:11 -07:00
committed by GitHub
parent e83e947ca3
commit 2bb6a3f4d0
4 changed files with 140 additions and 138 deletions

View File

@@ -96,6 +96,12 @@ func toAdminAPIErr(ctx context.Context, err error) APIError {
}
default:
switch {
case errors.Is(err, errTooManyPolicies):
apiErr = APIError{
Code: "XMinioAdminInvalidRequest",
Description: err.Error(),
HTTPStatusCode: http.StatusBadRequest,
}
case errors.Is(err, errDecommissionAlreadyRunning):
apiErr = APIError{
Code: "XMinioDecommissionNotAllowed",