diff --git a/api/handler/acl.go b/api/handler/acl.go index 86afb8e..9308377 100644 --- a/api/handler/acl.go +++ b/api/handler/acl.go @@ -171,7 +171,7 @@ func (h *handler) PutBucketACLHandler(w http.ResponseWriter, r *http.Request) { return } } else if err := xml.NewDecoder(r.Body).Decode(list); err != nil { - h.logAndSendError(w, "could not parse bucket acl", reqInfo, err) + h.logAndSendError(w, "could not parse bucket acl", reqInfo, errors.GetAPIError(errors.ErrMalformedXML)) return } @@ -263,7 +263,7 @@ func (h *handler) PutObjectACLHandler(w http.ResponseWriter, r *http.Request) { return } } else if err := xml.NewDecoder(r.Body).Decode(list); err != nil { - h.logAndSendError(w, "could not parse bucket acl", reqInfo, err) + h.logAndSendError(w, "could not parse bucket acl", reqInfo, errors.GetAPIError(errors.ErrMalformedXML)) return } diff --git a/api/handler/delete.go b/api/handler/delete.go index eb27ee7..281bbd1 100644 --- a/api/handler/delete.go +++ b/api/handler/delete.go @@ -106,7 +106,7 @@ func (h *handler) DeleteMultipleObjectsHandler(w http.ResponseWriter, r *http.Re // Unmarshal list of keys to be deleted. requested := &DeleteObjectsRequest{} if err := xml.NewDecoder(r.Body).Decode(requested); err != nil { - h.logAndSendError(w, "couldn't decode body", reqInfo, err) + h.logAndSendError(w, "couldn't decode body", reqInfo, errors.GetAPIError(errors.ErrMalformedXML)) return } diff --git a/api/handler/put.go b/api/handler/put.go index d753b71..0bd1f60 100644 --- a/api/handler/put.go +++ b/api/handler/put.go @@ -612,7 +612,7 @@ func parseLocationConstraint(r *http.Request) (*createBucketParams, error) { params := new(createBucketParams) if err := xml.NewDecoder(r.Body).Decode(params); err != nil { - return nil, err + return nil, errors.GetAPIError(errors.ErrMalformedXML) } return params, nil }