profiler: Download API returns error when all nodes fail (#6525)

When download profiling data API fails to gather profiling data
from all nodes for any reason (including profiler not enabled),
return 400 http code with the appropriate json message.
This commit is contained in:
Anis Elleuch
2018-09-27 18:34:37 +01:00
committed by kannappanr
parent ed703c065d
commit 6c7c6bec91
2 changed files with 14 additions and 2 deletions

View File

@@ -291,6 +291,7 @@ const (
ErrInvalidColumnIndex
ErrMissingHeaders
ErrAdminConfigNotificationTargetsFailed
ErrAdminProfilerNotEnabled
)
// error code to APIError structure, these fields carry respective
@@ -892,6 +893,11 @@ var errorCodeResponse = map[APIErrorCode]APIError{
Description: "Configuration update failed due an unsuccessful attempt to connect to one or more notification servers",
HTTPStatusCode: http.StatusBadRequest,
},
ErrAdminProfilerNotEnabled: {
Code: "XMinioAdminProfilerNotEnabled",
Description: "Unable to perform the requested operation because profiling is not enabled",
HTTPStatusCode: http.StatusBadRequest,
},
ErrAdminCredentialsMismatch: {
Code: "XMinioAdminCredentialsMismatch",
Description: "Credentials in config mismatch with server environment variables",