Bugfix: catch error from ParseConditions and refactor ParseConditions
Signed-off-by: Zhengyi Lai <zheng1@yunify.com>
This commit is contained in:
@@ -867,6 +867,12 @@ func (h *openpitrixHandler) ListRepos(req *restful.Request, resp *restful.Respon
|
||||
reverse := params.GetBoolValueWithDefault(req, params.ReverseParam, false)
|
||||
conditions, err := params.ParseConditions(req)
|
||||
|
||||
if err != nil {
|
||||
klog.V(4).Infoln(err)
|
||||
api.HandleBadRequest(resp, nil, err)
|
||||
return
|
||||
}
|
||||
|
||||
if req.PathParameter("workspace") != "" {
|
||||
conditions.Match[openpitrix.WorkspaceLabel] = req.PathParameter("workspace")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user