From 8203f9ff6ffcea68e9ce57a0c332cfcf6b4d2ec6 Mon Sep 17 00:00:00 2001 From: "shiro.lee" <69624924+shiroleeee@users.noreply.github.com> Date: Wed, 5 Nov 2025 23:48:54 +0800 Subject: [PATCH] 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) --- rustfs/src/storage/ecfs.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rustfs/src/storage/ecfs.rs b/rustfs/src/storage/ecfs.rs index ed38b2c2..2966776c 100644 --- a/rustfs/src/storage/ecfs.rs +++ b/rustfs/src/storage/ecfs.rs @@ -4160,6 +4160,13 @@ impl S3 for FS { let object_lock_configuration = match metadata_sys::get_object_lock_config(&bucket).await { Ok((cfg, _created)) => Some(cfg), 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); None }