constants and fixes

✅ Return InvalidRetentionPeriod for invalid retention values (0 days, negative years)
✅ Return ObjectLockConfigurationNotFoundError when object lock configuration doesn't exist
✅ Handle all object lock validation errors consistently with proper error codes
This commit is contained in:
chrislu committed 2025-07-18 15:58:07 -07:00
1 parent 1bc503530a
commit 7203c78e4d
6 files changed
+14 -8

No files matched your search

+6
View File
@@ -114,6 +114,7 @@ const (
ErrNoSuchObjectLockConfiguration
ErrNoSuchObjectLegalHold
ErrInvalidRetentionPeriod
ErrObjectLockConfigurationNotFoundError
)
// Error message constants for checksum validation
@@ -459,6 +460,11 @@ var errorCodeResponse = map[ErrorCode]APIError{
Description: "The bucket ownership controls were not found",
HTTPStatusCode: http.StatusNotFound,
},
ErrObjectLockConfigurationNotFoundError: {
Code: "ObjectLockConfigurationNotFoundError",
Description: "Object Lock configuration does not exist for this bucket",
HTTPStatusCode: http.StatusNotFound,
},
}
// GetAPIError provides API Error for input API error code.