fix check file not found use is_err_object_not_found

This commit is contained in:
weisd
2024-12-23 15:44:24 +08:00
parent a40c2e2978
commit b46a78fb63
4 changed files with 15 additions and 7 deletions
+3 -1
View File
@@ -1,4 +1,4 @@
use crate::{disk, error::Error};
use crate::{disk, error::Error, store_err::is_err_object_not_found};
#[derive(Debug, thiserror::Error)]
pub enum ConfigError {
@@ -20,6 +20,8 @@ pub fn is_not_found(err: &Error) -> bool {
ConfigError::is_not_found(e)
} else if let Some(e) = err.downcast_ref::<disk::error::DiskError>() {
matches!(e, disk::error::DiskError::FileNotFound)
} else if is_err_object_not_found(err) {
return true;
} else {
false
}