fs: All parts except the last part should be of the same size (#5045)

fixes #4881
This commit is contained in:
Krishna Srinivas
2017-10-17 12:01:28 -07:00
committed by Dee Koder
parent 3d2d63f71e
commit 75865efb0e
3 changed files with 30 additions and 0 deletions

View File

@@ -146,6 +146,7 @@ const (
ErrInvalidResourceName
ErrServerNotInitialized
ErrOperationTimedOut
ErrPartsSizeUnequal
// Add new extended error codes here.
// Please open a https://github.com/minio/minio/issues before adding
// new error codes here.
@@ -659,6 +660,11 @@ var errorCodeResponse = map[APIErrorCode]APIError{
Description: "Your metadata headers are not supported.",
HTTPStatusCode: http.StatusBadRequest,
},
ErrPartsSizeUnequal: {
Code: "XMinioPartsSizeUnequal",
Description: "All parts except the last part should be of the same size.",
HTTPStatusCode: http.StatusBadRequest,
},
// Add your error structure here.
}
@@ -755,6 +761,8 @@ func toAPIErrorCode(err error) (apiErr APIErrorCode) {
apiErr = ErrEntityTooLarge
case UnsupportedMetadata:
apiErr = ErrUnsupportedMetadata
case PartsSizeUnequal:
apiErr = ErrPartsSizeUnequal
default:
apiErr = ErrInternalError
}