diff --git a/Cargo.lock b/Cargo.lock
index 09ba10ff..5de2d546 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -311,7 +311,6 @@ dependencies = [
name = "ecstore"
version = "0.1.0"
dependencies = [
- "anyhow",
"async-trait",
"base64-simd",
"bytes",
diff --git a/ecstore/Cargo.toml b/ecstore/Cargo.toml
index 29dc282b..2c97f1a2 100644
--- a/ecstore/Cargo.toml
+++ b/ecstore/Cargo.toml
@@ -16,7 +16,6 @@ futures.workspace = true
async-trait.workspace = true
tracing.workspace = true
serde.workspace = true
-anyhow.workspace = true
time.workspace = true
serde_json.workspace = true
url = "2.5.2"
diff --git a/ecstore/src/bucket_meta.rs b/ecstore/src/bucket_meta.rs
index 1a9a1313..f089de50 100644
--- a/ecstore/src/bucket_meta.rs
+++ b/ecstore/src/bucket_meta.rs
@@ -2,7 +2,7 @@ use rmp_serde::Serializer;
use serde::{Deserialize, Serialize};
use time::OffsetDateTime;
-use anyhow::Result;
+use crate::error::Result;
use crate::disk::BUCKET_META_PREFIX;
@@ -40,12 +40,7 @@ impl BucketMetadata {
}
pub fn save_file_path(&self) -> String {
- format!(
- "{}/{}/{}",
- BUCKET_META_PREFIX,
- self.name.as_str(),
- BUCKET_METADATA_FILE
- )
+ format!("{}/{}/{}", BUCKET_META_PREFIX, self.name.as_str(), BUCKET_METADATA_FILE)
// PathBuf::new()
// .join(BUCKET_META_PREFIX)
// .join(self.name.as_str())
diff --git a/ecstore/src/disk/error.rs b/ecstore/src/disk/error.rs
new file mode 100644
index 00000000..d475332d
--- /dev/null
+++ b/ecstore/src/disk/error.rs
@@ -0,0 +1,99 @@
+use crate::error::{Error, Result, StdError};
+
+#[derive(Debug, thiserror::Error)]
+pub enum DiskError {
+ #[error("file not found")]
+ FileNotFound,
+
+ #[error("file version not found")]
+ FileVersionNotFound,
+
+ #[error("disk not found")]
+ DiskNotFound,
+
+ #[error("disk access denied")]
+ FileAccessDenied,
+
+ #[error("InconsistentDisk")]
+ InconsistentDisk,
+
+ #[error("volume already exists")]
+ VolumeExists,
+
+ #[error("unformatted disk error")]
+ UnformattedDisk,
+
+ #[error("unsupport disk")]
+ UnsupportedDisk,
+
+ #[error("disk not a dir")]
+ DiskNotDir,
+
+ #[error("volume not found")]
+ VolumeNotFound,
+}
+
+impl DiskError {
+ pub fn check_disk_fatal_errs(errs: &Vec