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:
Harshavardhana
2016-06-28 14:51:49 -07:00
committed by GitHub
parent 6dcfa7b046
commit 748dc80047
8 changed files with 188 additions and 7 deletions
+1 -1
View File
@@ -506,7 +506,7 @@ func writeErrorResponse(w http.ResponseWriter, req *http.Request, errorCode APIE
}
func writeErrorResponseNoHeader(w http.ResponseWriter, req *http.Request, error APIError, resource string) {
// generate error response
// Generate error response.
errorResponse := getAPIErrorResponse(error, resource)
encodedErrorResponse := encodeResponse(errorResponse)
// HEAD should have no body, do not attempt to write to it