mirror of
https://github.com/minio/minio
synced 2024-09-05 16:26:28 +00:00
return appropriate error upon tier update for incorrect credentials (#20034)
This commit is contained in:
parent
32d04091a2
commit
88926ad8e9
|
@ -216,6 +216,12 @@ func toAdminAPIErr(ctx context.Context, err error) APIError {
|
|||
Description: err.Error(),
|
||||
HTTPStatusCode: http.StatusBadRequest,
|
||||
}
|
||||
case errors.Is(err, errTierInvalidConfig):
|
||||
apiErr = APIError{
|
||||
Code: "XMinioAdminTierInvalidConfig",
|
||||
Description: err.Error(),
|
||||
HTTPStatusCode: http.StatusBadRequest,
|
||||
}
|
||||
default:
|
||||
apiErr = errorCodes.ToAPIErrWithErr(toAdminAPIErrCode(ctx, err), err)
|
||||
}
|
||||
|
|
|
@ -64,6 +64,12 @@ var (
|
|||
Message: "Specified remote backend is not empty",
|
||||
StatusCode: http.StatusBadRequest,
|
||||
}
|
||||
|
||||
errTierInvalidConfig = AdminError{
|
||||
Code: "XMinioAdminTierInvalidConfig",
|
||||
Message: "Unable to setup remote tier, check tier configuration",
|
||||
StatusCode: http.StatusBadRequest,
|
||||
}
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
|
@ -144,7 +144,8 @@ func newWarmBackend(ctx context.Context, tier madmin.TierConfig, probe bool) (d
|
|||
return nil, errTierTypeUnsupported
|
||||
}
|
||||
if err != nil {
|
||||
return nil, errTierTypeUnsupported
|
||||
tierLogIf(ctx, err)
|
||||
return nil, errTierInvalidConfig
|
||||
}
|
||||
|
||||
if probe {
|
||||
|
|
Loading…
Reference in a new issue