提交 66dd5ac7 编写于 作者: LinuxSuRen's avatar LinuxSuRen

Keep the orignal error messages with log printing instead swallow them

Signed-off-by: LinuxSuRen's avatarrick <rick@jenkins-zh.cn>
上级 d35e22f0
......@@ -101,6 +101,7 @@ func (p *Pipeline) GetPipeline() (*devops.Pipeline, error) {
func (p *Pipeline) ListPipelines() (*devops.PipelineList, error) {
res, _, err := p.Jenkins.SendPureRequestWithHeaderResp(p.Path, p.HttpParameters)
if err != nil {
klog.Error(err)
if jErr, ok := err.(*JkError); ok {
switch jErr.Code {
case 404:
......@@ -111,7 +112,6 @@ func (p *Pipeline) ListPipelines() (*devops.PipelineList, error) {
klog.Errorf("API '%s' request response code is '%d'", p.Path, jErr.Code)
} else {
err = fmt.Errorf("unknow errors happend when coumunicate with Jenkins")
klog.Error(err)
}
return nil, err
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册