From e9583c6a47ec939454845180b6a95f7b06588b4b Mon Sep 17 00:00:00 2001 From: weisd Date: Wed, 20 Nov 2024 16:10:14 +0800 Subject: [PATCH] add put_object_metadata --- ecstore/src/store_err.rs | 3 +++ ecstore/src/store_init.rs | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ecstore/src/store_err.rs b/ecstore/src/store_err.rs index 1f4520cc5..b7f0f09ce 100644 --- a/ecstore/src/store_err.rs +++ b/ecstore/src/store_err.rs @@ -9,6 +9,9 @@ pub enum StorageError { #[error("Invalid arguments provided for {0}/{1}-{2}")] InvalidArgument(String, String, String), + #[error("method not allowed")] + MethodNotAllowed, + #[error("Bucket not found: {0}")] BucketNotFound(String), diff --git a/ecstore/src/store_init.rs b/ecstore/src/store_init.rs index 6d8f7dd53..a02da5bbb 100644 --- a/ecstore/src/store_init.rs +++ b/ecstore/src/store_init.rs @@ -290,7 +290,7 @@ pub fn ec_drives_no_config(set_drive_count: usize) -> Result { Ok(sc.get_parity_for_sc(storageclass::STANDARD).unwrap_or_default()) } -#[derive(Debug, thiserror::Error)] +#[derive(Debug, PartialEq, thiserror::Error)] pub enum ErasureError { #[error("erasure read quorum")] ErasureReadQuorum, @@ -307,3 +307,13 @@ pub enum ErasureError { #[error("invalid part id {0}")] InvalidPart(usize), } + +impl ErasureError { + pub fn is(&self, err: &Error) -> bool { + if let Some(e) = err.downcast_ref::() { + return self == e; + } + + false + } +}