Suppress error log for force-deleting object in locked bucket (#19378)

This commit is contained in:
Kaan Kabalak 2024-03-28 14:37:42 -07:00 committed by GitHub
parent 468a9fae83
commit 3f72439b8a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2826,7 +2826,9 @@ func (api objectAPIHandlers) DeleteObjectHandler(w http.ResponseWriter, r *http.
rcfg, _ := globalBucketObjectLockSys.Get(bucket)
if rcfg.LockEnabled && opts.DeletePrefix {
writeErrorResponse(ctx, w, toAPIError(ctx, errors.New("force-delete is forbidden in a locked-enabled bucket")), r.URL)
apiErr := toAPIError(ctx, errInvalidArgument)
apiErr.Description = "force-delete is forbidden on Object Locking enabled buckets"
writeErrorResponse(ctx, w, apiErr, r.URL)
return
}