Move the ObjectAPI() resource to be beginning of each handlers.

We should return back proper errors so that the clients can
retry until server has been initialized.
This commit is contained in:
Harshavardhana
2016-08-10 18:47:49 -07:00
parent b0f3f94163
commit 4917038f55
6 changed files with 171 additions and 118 deletions

View File

@@ -134,6 +134,7 @@ const (
ErrObjectExistsAsDirectory
ErrPolicyNesting
ErrInvalidObjectName
ErrServerNotInitialized
// Add new extended error codes here.
// Please open a https://github.com/minio/minio/issues before adding
// new error codes here.
@@ -556,6 +557,11 @@ var errorCodeResponse = map[APIErrorCode]APIError{
Description: "Object name contains unsupported characters. Unsupported characters are `^*|\\\"",
HTTPStatusCode: http.StatusBadRequest,
},
ErrServerNotInitialized: {
Code: "XMinioServerNotInitialized",
Description: "Server not initialized, please try again.",
HTTPStatusCode: http.StatusServiceUnavailable,
},
// Add your error structure here.
}