refactor(ecstore): simplify bucket metadata error handling by using ConfigNotFound

- Remove specific bucket metadata error variants (BucketPolicyNotFound, etc.)
- Unify all configuration-not-found errors to use StorageError::ConfigNotFound
- Simplify error handling in bucket metadata system by removing redundant error conversions
- Clean up error matching patterns in metadata getter methods
- Remove debug print statement from get_bucket_targets_config
- Update error handling in S3 API layer to use unified ConfigNotFound error

This change improves code maintainability by reducing error type complexity
while preserving the same error semantics for API consumers.
This commit is contained in:
weisd
2025-06-23 17:04:14 +08:00
parent 811d1a598b
commit 317cadaed8
4 changed files with 39 additions and 126 deletions
+1 -1
View File
@@ -1601,7 +1601,7 @@ impl S3 for FS {
let cfg = match PolicySys::get(&bucket).await {
Ok(res) => res,
Err(err) => {
if StorageError::BucketPolicyNotFound == err {
if StorageError::ConfigNotFound == err {
return Err(s3_error!(NoSuchBucketPolicy));
}
return Err(S3Error::with_message(S3ErrorCode::InternalError, err.to_string()));