mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-08 06:13:14 +00:00
fix check file not found use is_err_object_not_found
This commit is contained in:
+2
-1
@@ -7,6 +7,7 @@ use std::{
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
use ecstore::store_err::is_err_object_not_found;
|
||||
use log::debug;
|
||||
use time::OffsetDateTime;
|
||||
use tokio::{
|
||||
@@ -113,7 +114,7 @@ where
|
||||
async fn save_iam_formatter(self: Arc<Self>) -> crate::Result<()> {
|
||||
match self.api.load_iam_config::<Format>(Format::PATH).await {
|
||||
Ok((format, _)) if format.version >= 1 => return Ok(()),
|
||||
Err(Error::EcstoreError(e)) if !ecstore::disk::error::is_err_file_not_found(&e) => {
|
||||
Err(Error::EcstoreError(e)) if !is_err_object_not_found(&e) => {
|
||||
return Err(Error::EcstoreError(e));
|
||||
}
|
||||
_ => {}
|
||||
|
||||
@@ -60,8 +60,13 @@ impl ObjectStore {
|
||||
|
||||
match items {
|
||||
Ok(items) => Result::<_, crate::Error>::Ok(items.prefixes),
|
||||
Err(e) if is_not_found(&e) => Result::<_, crate::Error>::Ok(vec![]),
|
||||
Err(e) => Err(Error::StringError(format!("list {prefix} failed, err: {e:?}"))),
|
||||
Err(e) => {
|
||||
if is_not_found(&e) {
|
||||
Result::<_, crate::Error>::Ok(vec![])
|
||||
} else {
|
||||
Err(Error::StringError(format!("list {prefix} failed, err: {e:?}")))
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user