mirror of
https://github.com/minio/minio.git
synced 2025-04-19 10:07:30 -04:00
Fix error message wording for PutObjectLockConfig (#8759)
Co-Authored-By: kannappanr <30541348+kannappanr@users.noreply.github.com> Co-authored-by: Harshavardhana <harsha@minio.io>
This commit is contained in:
parent
3d318bae76
commit
fd56aa42a6
@ -143,6 +143,7 @@ const (
|
|||||||
ErrBadRequest
|
ErrBadRequest
|
||||||
ErrKeyTooLongError
|
ErrKeyTooLongError
|
||||||
ErrInvalidBucketObjectLockConfiguration
|
ErrInvalidBucketObjectLockConfiguration
|
||||||
|
ErrObjectLockConfigurationNotAllowed
|
||||||
ErrObjectLocked
|
ErrObjectLocked
|
||||||
ErrInvalidRetentionDate
|
ErrInvalidRetentionDate
|
||||||
ErrPastObjectLockRetainDate
|
ErrPastObjectLockRetainDate
|
||||||
@ -732,6 +733,11 @@ var errorCodes = errorCodeMap{
|
|||||||
Description: "Bucket is missing ObjectLockConfiguration",
|
Description: "Bucket is missing ObjectLockConfiguration",
|
||||||
HTTPStatusCode: http.StatusBadRequest,
|
HTTPStatusCode: http.StatusBadRequest,
|
||||||
},
|
},
|
||||||
|
ErrObjectLockConfigurationNotAllowed: {
|
||||||
|
Code: "InvalidBucketState",
|
||||||
|
Description: "Object Lock configuration cannot be enabled on existing buckets.",
|
||||||
|
HTTPStatusCode: http.StatusConflict,
|
||||||
|
},
|
||||||
ErrObjectLocked: {
|
ErrObjectLocked: {
|
||||||
Code: "InvalidRequest",
|
Code: "InvalidRequest",
|
||||||
Description: "Object is WORM protected and cannot be overwritten",
|
Description: "Object is WORM protected and cannot be overwritten",
|
||||||
|
@ -1017,7 +1017,7 @@ func (api objectAPIHandlers) PutBucketObjectLockConfigHandler(w http.ResponseWri
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
aerr := toAPIError(ctx, err)
|
aerr := toAPIError(ctx, err)
|
||||||
if err == errConfigNotFound {
|
if err == errConfigNotFound {
|
||||||
aerr = errorCodes.ToAPIErr(ErrMethodNotAllowed)
|
aerr = errorCodes.ToAPIErr(ErrObjectLockConfigurationNotAllowed)
|
||||||
}
|
}
|
||||||
writeErrorResponse(ctx, w, aerr, r.URL, guessIsBrowserReq(r))
|
writeErrorResponse(ctx, w, aerr, r.URL, guessIsBrowserReq(r))
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user