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:
@@ -14,8 +14,9 @@
|
||||
// limitations under the License.
|
||||
|
||||
use minio::s3::client::DEFAULT_REGION;
|
||||
use minio::s3::error::{Error, ErrorCode};
|
||||
use minio::s3::error::{Error, S3ServerError};
|
||||
use minio::s3::lifecycle_config::LifecycleConfig;
|
||||
use minio::s3::minio_error_response::MinioErrorCode;
|
||||
use minio::s3::response::a_response_traits::{HasBucket, HasRegion};
|
||||
use minio::s3::response::{
|
||||
DeleteBucketLifecycleResponse, GetBucketLifecycleResponse, PutBucketLifecycleResponse,
|
||||
@@ -74,10 +75,9 @@ async fn bucket_lifecycle(ctx: TestContext, bucket_name: String) {
|
||||
let resp: Result<GetBucketLifecycleResponse, Error> =
|
||||
ctx.client.get_bucket_lifecycle(&bucket_name).send().await;
|
||||
match resp {
|
||||
Err(Error::S3Error(e)) => assert_eq!(e.code, ErrorCode::NoSuchLifecycleConfiguration),
|
||||
v => panic!(
|
||||
"Expected error S3Error(NoSuchLifecycleConfiguration): but got {:?}",
|
||||
v
|
||||
),
|
||||
Err(Error::S3Server(S3ServerError::S3Error(e))) => {
|
||||
assert_eq!(e.code(), MinioErrorCode::NoSuchLifecycleConfiguration)
|
||||
}
|
||||
v => panic!("Expected error S3Error(NoSuchLifecycleConfiguration): but got {v:?}"),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user