From 088c595e01cb6cb501071e7df1954155278c190b Mon Sep 17 00:00:00 2001 From: Wenjie Date: Thu, 18 Oct 2018 00:20:58 +0800 Subject: [PATCH] handle exception InvalidPart (#6649) --- cmd/gateway-common.go | 2 ++ cmd/gateway/s3/gateway-s3_test.go | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/cmd/gateway-common.go b/cmd/gateway-common.go index c37b2ea67..e2af9a356 100644 --- a/cmd/gateway-common.go +++ b/cmd/gateway-common.go @@ -294,6 +294,8 @@ func ErrorRespToObjectError(err error, params ...string) error { err = BucketPolicyNotFound{} case "InvalidBucketName": err = BucketNameInvalid{Bucket: bucket} + case "InvalidPart": + err = InvalidPart{} case "NoSuchBucket": err = BucketNotFound{Bucket: bucket} case "NoSuchKey": diff --git a/cmd/gateway/s3/gateway-s3_test.go b/cmd/gateway/s3/gateway-s3_test.go index a787bc918..bc2d29097 100644 --- a/cmd/gateway/s3/gateway-s3_test.go +++ b/cmd/gateway/s3/gateway-s3_test.go @@ -50,6 +50,10 @@ func TestS3ToObjectError(t *testing.T) { inputErr: errResponse("InvalidBucketName"), expectedErr: minio.BucketNameInvalid{}, }, + { + inputErr: errResponse("InvalidPart"), + expectedErr: minio.InvalidPart{}, + }, { inputErr: errResponse("NoSuchBucketPolicy"), expectedErr: minio.BucketPolicyNotFound{},