handle exception InvalidPart (#6649)

master
Wenjie 6 years ago committed by Nitish Tiwari
parent 26b4b466df
commit 088c595e01
  1. 2
      cmd/gateway-common.go
  2. 4
      cmd/gateway/s3/gateway-s3_test.go

@ -294,6 +294,8 @@ func ErrorRespToObjectError(err error, params ...string) error {
err = BucketPolicyNotFound{} err = BucketPolicyNotFound{}
case "InvalidBucketName": case "InvalidBucketName":
err = BucketNameInvalid{Bucket: bucket} err = BucketNameInvalid{Bucket: bucket}
case "InvalidPart":
err = InvalidPart{}
case "NoSuchBucket": case "NoSuchBucket":
err = BucketNotFound{Bucket: bucket} err = BucketNotFound{Bucket: bucket}
case "NoSuchKey": case "NoSuchKey":

@ -50,6 +50,10 @@ func TestS3ToObjectError(t *testing.T) {
inputErr: errResponse("InvalidBucketName"), inputErr: errResponse("InvalidBucketName"),
expectedErr: minio.BucketNameInvalid{}, expectedErr: minio.BucketNameInvalid{},
}, },
{
inputErr: errResponse("InvalidPart"),
expectedErr: minio.InvalidPart{},
},
{ {
inputErr: errResponse("NoSuchBucketPolicy"), inputErr: errResponse("NoSuchBucketPolicy"),
expectedErr: minio.BucketPolicyNotFound{}, expectedErr: minio.BucketPolicyNotFound{},

Loading…
Cancel
Save