Refactor/cleanup errors (#179)
* error refactored: moved to thiserror * Result type alias for better ergonomics: * removed field from MinioErrorCode::BucketNotEmpty enum * made field private of MinioErrorResponse * updated XmlError * simplified calling errors * bumped toolchain channel form 1.86.0 to 1.87.0 * bumped toolchain channel form 1.87.0 to 1.88.0 due to clippy fixes that are not compatible with 1.87.0
This commit is contained in:
@@ -15,7 +15,8 @@
|
||||
|
||||
use minio::s3::builders::VersioningStatus;
|
||||
use minio::s3::client::DEFAULT_REGION;
|
||||
use minio::s3::error::{Error, ErrorCode};
|
||||
use minio::s3::error::{Error, S3ServerError};
|
||||
use minio::s3::minio_error_response::MinioErrorCode;
|
||||
use minio::s3::response::a_response_traits::{HasBucket, HasRegion};
|
||||
use minio::s3::response::{GetBucketVersioningResponse, PutBucketVersioningResponse};
|
||||
use minio::s3::types::S3Api;
|
||||
@@ -73,14 +74,18 @@ async fn bucket_versioning_s3express(ctx: TestContext, bucket_name: String) {
|
||||
.send()
|
||||
.await;
|
||||
match resp {
|
||||
Err(Error::S3Error(e)) => assert_eq!(e.code, ErrorCode::NotSupported),
|
||||
v => panic!("Expected error S3Error(NotSupported): but got {:?}", v),
|
||||
Err(Error::S3Server(S3ServerError::S3Error(e))) => {
|
||||
assert_eq!(e.code(), MinioErrorCode::NotSupported)
|
||||
}
|
||||
v => panic!("Expected error S3Error(NotSupported): but got {v:?}"),
|
||||
}
|
||||
|
||||
let resp: Result<GetBucketVersioningResponse, Error> =
|
||||
ctx.client.get_bucket_versioning(&bucket_name).send().await;
|
||||
match resp {
|
||||
Err(Error::S3Error(e)) => assert_eq!(e.code, ErrorCode::NotSupported),
|
||||
v => panic!("Expected error S3Error(NotSupported): but got {:?}", v),
|
||||
Err(Error::S3Server(S3ServerError::S3Error(e))) => {
|
||||
assert_eq!(e.code(), MinioErrorCode::NotSupported)
|
||||
}
|
||||
v => panic!("Expected error S3Error(NotSupported): but got {v:?}"),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user