mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-17 10:17:55 +00:00
done bucket policy, need test
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user