done bucket policy, need test

This commit is contained in:
weisd
2024-10-12 00:41:03 +08:00
parent 2ec64ce5a4
commit 81dc3d4404
19 changed files with 1846 additions and 147 deletions
+13 -1
View File
@@ -1,4 +1,6 @@
#[derive(Debug, thiserror::Error)]
use crate::error::Error;
#[derive(Debug, thiserror::Error, PartialEq, Eq)]
pub enum BucketMetadataError {
#[error("tagging not found")]
TaggingNotFound,
@@ -17,3 +19,13 @@ pub enum BucketMetadataError {
#[error("bucket remote target not found")]
BucketRemoteTargetNotFound,
}
impl BucketMetadataError {
pub fn is(&self, err: &Error) -> bool {
if let Some(e) = err.downcast_ref::<BucketMetadataError>() {
e == self
} else {
false
}
}
}