mirror of
https://github.com/cubefs/cubefs.git
synced 2026-08-02 02:00:56 +00:00
fix(objectnode): fix incorrect statusCode when creating volume in objectnode. #1000146602
Signed-off-by: zhumingze <zhumingze@oppo.com>
This commit is contained in:
parent
15b24c6d0e
commit
b74b3fa74e
@ -123,6 +123,11 @@ func (o *ObjectNode) createBucketHandler(w http.ResponseWriter, r *http.Request)
|
||||
if err = o.mc.AdminAPI().CreateDefaultVolume(bucket, userInfo.UserID); err != nil {
|
||||
log.LogErrorf("createBucketHandler: create bucket fail: requestID(%v) volume(%v) accessKey(%v) err(%v)",
|
||||
GetRequestID(r), bucket, param.AccessKey(), err)
|
||||
if err == proto.ErrDuplicateVol {
|
||||
err = DuplicateVol
|
||||
} else {
|
||||
err = InternalErrorCode(err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@ -90,6 +90,7 @@ var (
|
||||
ObjectLockConfigurationNotFound = &ErrorCode{"ObjectLockConfigurationNotFoundError", "Object Lock configuration does not exist for this bucket", http.StatusNotFound}
|
||||
TooManyRequests = &ErrorCode{"TooManyRequests", "too many requests, please retry later", http.StatusTooManyRequests}
|
||||
MalformedPOSTRequest = &ErrorCode{ErrorCode: "MalformedPOSTRequest", ErrorMessage: "The body of your POST request is not well-formed multipart/form-data.", StatusCode: http.StatusBadRequest}
|
||||
DuplicateVol = &ErrorCode{ErrorCode: "DuplicateVol", ErrorMessage: "Duplicate Vol", StatusCode: http.StatusBadRequest}
|
||||
)
|
||||
|
||||
type ErrorCode struct {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user