mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05: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(),
|
Description: err.Error(),
|
||||||
HTTPStatusCode: http.StatusBadRequest,
|
HTTPStatusCode: http.StatusBadRequest,
|
||||||
}
|
}
|
||||||
|
case errors.Is(err, errTierInvalidConfig):
|
||||||
|
apiErr = APIError{
|
||||||
|
Code: "XMinioAdminTierInvalidConfig",
|
||||||
|
Description: err.Error(),
|
||||||
|
HTTPStatusCode: http.StatusBadRequest,
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
apiErr = errorCodes.ToAPIErrWithErr(toAdminAPIErrCode(ctx, err), err)
|
apiErr = errorCodes.ToAPIErrWithErr(toAdminAPIErrCode(ctx, err), err)
|
||||||
}
|
}
|
||||||
|
@ -64,6 +64,12 @@ var (
|
|||||||
Message: "Specified remote backend is not empty",
|
Message: "Specified remote backend is not empty",
|
||||||
StatusCode: http.StatusBadRequest,
|
StatusCode: http.StatusBadRequest,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
errTierInvalidConfig = AdminError{
|
||||||
|
Code: "XMinioAdminTierInvalidConfig",
|
||||||
|
Message: "Unable to setup remote tier, check tier configuration",
|
||||||
|
StatusCode: http.StatusBadRequest,
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -144,7 +144,8 @@ func newWarmBackend(ctx context.Context, tier madmin.TierConfig, probe bool) (d
|
|||||||
return nil, errTierTypeUnsupported
|
return nil, errTierTypeUnsupported
|
||||||
}
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errTierTypeUnsupported
|
tierLogIf(ctx, err)
|
||||||
|
return nil, errTierInvalidConfig
|
||||||
}
|
}
|
||||||
|
|
||||||
if probe {
|
if probe {
|
||||||
|
Loading…
Reference in New Issue
Block a user