mirror of
https://github.com/minio/minio.git
synced 2025-11-20 18:06:10 -05:00
fs: Fail createObject with appropriate message.
Fail createObject() if a file already exists and one attempts to create a prefix/directory by same name. Send an approriate error back to the client as 409 Conflict.
This commit is contained in:
@@ -74,6 +74,7 @@ const (
|
||||
SignatureVersionNotSupported
|
||||
BucketNotEmpty
|
||||
RootPathFull
|
||||
ObjectExistsAsPrefix
|
||||
)
|
||||
|
||||
// APIError code to Error structure map
|
||||
@@ -238,6 +239,11 @@ var errorCodeResponse = map[int]APIError{
|
||||
Description: "Root path has reached its minimum free disk threshold. Please delete few objects to proceed.",
|
||||
HTTPStatusCode: http.StatusInternalServerError,
|
||||
},
|
||||
ObjectExistsAsPrefix: {
|
||||
Code: "ObjectExistsAsPrefix",
|
||||
Description: "An object already exists as your prefix, choose a different prefix to proceed.",
|
||||
HTTPStatusCode: http.StatusConflict,
|
||||
},
|
||||
}
|
||||
|
||||
// errorCodeError provides errorCode to Error. It returns empty if the code provided is unknown
|
||||
|
||||
Reference in New Issue
Block a user