提交 4d19c4db 编写于 作者: LinuxSuRen's avatar LinuxSuRen

Provide a specific log level instead of using log.error

unifi variable declare style
Signed-off-by: LinuxSuRen's avatarrick <rick@jenkins-zh.cn>
上级 92e7349c
...@@ -236,7 +236,7 @@ func (h *ProjectPipelineHandler) createdBy(projectName string, pipelineName stri ...@@ -236,7 +236,7 @@ func (h *ProjectPipelineHandler) createdBy(projectName string, pipelineName stri
return creator == currentUserName return creator == currentUserName
} }
} else { } else {
log.Error(fmt.Sprintf("cannot get pipeline %s/%s, error %#v", projectName, pipelineName, err)) log.V(4).Infof("cannot get pipeline %s/%s, error %#v", projectName, pipelineName, err)
} }
return false return false
} }
...@@ -298,7 +298,7 @@ func (h *ProjectPipelineHandler) hasSubmitPermission(req *restful.Request) (hasP ...@@ -298,7 +298,7 @@ func (h *ProjectPipelineHandler) hasSubmitPermission(req *restful.Request) (hasP
break break
} }
} else { } else {
log.Errorf("cannot get nodes detail, error: %v", err) log.V(4).Infof("cannot get nodes detail, error: %v", err)
err = errors.New("cannot get the submitters of current pipeline run") err = errors.New("cannot get the submitters of current pipeline run")
return return
} }
...@@ -312,11 +312,9 @@ func (h *ProjectPipelineHandler) SubmitInputStep(req *restful.Request, resp *res ...@@ -312,11 +312,9 @@ func (h *ProjectPipelineHandler) SubmitInputStep(req *restful.Request, resp *res
nodeId := req.PathParameter("node") nodeId := req.PathParameter("node")
stepId := req.PathParameter("step") stepId := req.PathParameter("step")
var ( var response []byte
response []byte var err error
err error var ok bool
ok bool
)
if ok, err = h.hasSubmitPermission(req); !ok || err != nil { if ok, err = h.hasSubmitPermission(req); !ok || err != nil {
msg := map[string]string{ msg := map[string]string{
...@@ -520,11 +518,9 @@ func (h *ProjectPipelineHandler) SubmitBranchInputStep(req *restful.Request, res ...@@ -520,11 +518,9 @@ func (h *ProjectPipelineHandler) SubmitBranchInputStep(req *restful.Request, res
nodeId := req.PathParameter("node") nodeId := req.PathParameter("node")
stepId := req.PathParameter("step") stepId := req.PathParameter("step")
var ( var response []byte
response []byte var err error
err error var ok bool
ok bool
)
if ok, err = h.hasSubmitPermission(req); !ok || err != nil { if ok, err = h.hasSubmitPermission(req); !ok || err != nil {
msg := map[string]string{ msg := map[string]string{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册