mirror of
https://github.com/minio/minio.git
synced 2025-11-20 01:50:24 -05:00
API: add writePartTooSmallErrorResponse to extend standard error responses. (#2005)
This function is added to extend the standard error responses. Which is needed in some cases for example CompleteMultipartUpload should respond with ErrPartTooSmall error when parts uploaded are lesser than 5MB (i.e minimum allowed size per part). Fixes #1536
This commit is contained in:
@@ -594,7 +594,11 @@ func (xl xlObjects) CompleteMultipartUpload(bucket string, object string, upload
|
||||
|
||||
// All parts except the last part has to be atleast 5MB.
|
||||
if (i < len(parts)-1) && !isMinAllowedPartSize(currentXLMeta.Parts[partIdx].Size) {
|
||||
return "", PartTooSmall{}
|
||||
return "", PartTooSmall{
|
||||
PartNumber: part.PartNumber,
|
||||
PartSize: currentXLMeta.Parts[partIdx].Size,
|
||||
PartETag: part.ETag,
|
||||
}
|
||||
}
|
||||
|
||||
// Last part could have been uploaded as 0bytes, do not need
|
||||
|
||||
Reference in New Issue
Block a user