mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-18 02:33:15 +00:00
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:
@@ -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()));
|
||||
|
||||
Reference in New Issue
Block a user