mirror of
https://github.com/minio/minio.git
synced 2025-01-25 21:53:16 -05:00
gateway-azure: Return right error when Part size is > 100MB (#4652)
This commit is contained in:
parent
c3dd7c1f6c
commit
ce7c9c651d
@ -725,6 +725,8 @@ func toAPIErrorCode(err error) (apiErr APIErrorCode) {
|
|||||||
apiErr = ErrNotImplemented
|
apiErr = ErrNotImplemented
|
||||||
case PolicyNotFound:
|
case PolicyNotFound:
|
||||||
apiErr = ErrNoSuchBucketPolicy
|
apiErr = ErrNoSuchBucketPolicy
|
||||||
|
case PartTooBig:
|
||||||
|
apiErr = ErrEntityTooLarge
|
||||||
default:
|
default:
|
||||||
apiErr = ErrInternalError
|
apiErr = ErrInternalError
|
||||||
}
|
}
|
||||||
|
@ -142,6 +142,8 @@ func azureToObjectError(err error, params ...string) error {
|
|||||||
err = BucketExists{Bucket: bucket}
|
err = BucketExists{Bucket: bucket}
|
||||||
case "InvalidResourceName":
|
case "InvalidResourceName":
|
||||||
err = BucketNameInvalid{Bucket: bucket}
|
err = BucketNameInvalid{Bucket: bucket}
|
||||||
|
case "RequestBodyTooLarge":
|
||||||
|
err = PartTooBig{}
|
||||||
default:
|
default:
|
||||||
switch azureErr.StatusCode {
|
switch azureErr.StatusCode {
|
||||||
case http.StatusNotFound:
|
case http.StatusNotFound:
|
||||||
|
@ -343,6 +343,13 @@ func (e PartTooSmall) Error() string {
|
|||||||
return fmt.Sprintf("Part size for %d should be atleast 5MB", e.PartNumber)
|
return fmt.Sprintf("Part size for %d should be atleast 5MB", e.PartNumber)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PartTooBig returned if size of part is bigger than the allowed limit.
|
||||||
|
type PartTooBig struct{}
|
||||||
|
|
||||||
|
func (e PartTooBig) Error() string {
|
||||||
|
return "Part size bigger than the allowed limit"
|
||||||
|
}
|
||||||
|
|
||||||
// NotImplemented If a feature is not implemented
|
// NotImplemented If a feature is not implemented
|
||||||
type NotImplemented struct{}
|
type NotImplemented struct{}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user