Implement proper errors for Multipart

This commit is contained in:
Harshavardhana
2015-05-08 02:02:51 -07:00
parent 39e0875699
commit 2ea10c798b
5 changed files with 88 additions and 9 deletions
+7 -1
View File
@@ -64,11 +64,12 @@ const (
TooManyBuckets
MethodNotAllowed
InvalidPart
InvalidPartOrder
)
// Error codes, non exhaustive list - standard HTTP errors
const (
NotAcceptable = iota + 24
NotAcceptable = iota + 25
)
// Error code to Error structure map
@@ -193,6 +194,11 @@ var errorCodeResponse = map[int]Error{
Description: "One or more of the specified parts could not be found",
HTTPStatusCode: http.StatusBadRequest,
},
InvalidPartOrder: {
Code: "InvalidPartOrder",
Description: "The list of parts was not in ascending order. The parts list must be specified in order by part number.",
HTTPStatusCode: http.StatusBadRequest,
},
}
// errorCodeError provides errorCode to Error. It returns empty if the code provided is unknown