legacy API compatibility

Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
hongming
2020-07-29 01:50:34 +08:00
parent 93b123c1f0
commit 7884bcef95
5 changed files with 63 additions and 8 deletions

View File

@@ -103,6 +103,9 @@ func (h *devopsHandler) CreateDevOpsProject(request *restful.Request, response *
if errors.IsNotFound(err) {
api.HandleNotFound(response, request, err)
return
} else if errors.IsConflict(err) {
api.HandleConflict(response, request, err)
return
}
api.HandleBadRequest(response, request, err)
return

View File

@@ -1222,7 +1222,7 @@ func (h *iamHandler) ListUserLoginRecords(request *restful.Request, response *re
}
func handleError(request *restful.Request, response *restful.Response, err error) {
if errors.IsBadRequest(err) {
if errors.IsBadRequest(err) || errors.IsInvalid(err) {
api.HandleBadRequest(response, request, err)
} else if errors.IsNotFound(err) {
api.HandleNotFound(response, request, err)