mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-20 19:42:17 +00:00
fix: when the Object Lock configuration does not exist, an error message should be returned (#771) (#798)
fix: when the Object Lock configuration does not exist, an error message should be returned (#771) (#798)
This commit is contained in:
@@ -4160,6 +4160,13 @@ impl S3 for FS {
|
|||||||
let object_lock_configuration = match metadata_sys::get_object_lock_config(&bucket).await {
|
let object_lock_configuration = match metadata_sys::get_object_lock_config(&bucket).await {
|
||||||
Ok((cfg, _created)) => Some(cfg),
|
Ok((cfg, _created)) => Some(cfg),
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
|
if err == StorageError::ConfigNotFound {
|
||||||
|
return Err(S3Error::with_message(
|
||||||
|
S3ErrorCode::ObjectLockConfigurationNotFoundError,
|
||||||
|
"Object Lock configuration does not exist for this bucket".to_string(),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
debug!("get_object_lock_config err {:?}", err);
|
debug!("get_object_lock_config err {:?}", err);
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user