mirror of
https://github.com/minio/minio.git
synced 2025-11-25 20:16:10 -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:
@@ -251,8 +251,12 @@ func (e InvalidPartOrder) Error() string {
|
||||
}
|
||||
|
||||
// PartTooSmall - error if part size is less than 5MB.
|
||||
type PartTooSmall struct{}
|
||||
type PartTooSmall struct {
|
||||
PartSize int64
|
||||
PartNumber int
|
||||
PartETag string
|
||||
}
|
||||
|
||||
func (e PartTooSmall) Error() string {
|
||||
return "Part size should be atleast 5MB"
|
||||
return fmt.Sprintf("Part size for %d should be atleast 5MB", e.PartNumber)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user