未验证 提交 e0e5f2ae 编写于 作者: LinuxSuRen's avatar LinuxSuRen 提交者: GitHub

Merge pull request #97 from LinuxSuRen/fix/restart-err-output

Fix the error output when restarting Jenkins
......@@ -31,7 +31,9 @@ func (q *CoreClient) Restart() (err error) {
code := response.StatusCode
var data []byte
data, err = ioutil.ReadAll(response.Body)
if code != 200 || err != nil {
if code == 503 { // Jenkins could be behind of a proxy
fmt.Println("Please wait while Jenkins is restarting")
} else if code != 200 || err != nil {
log.Fatalf("Error code: %d, response: %s, errror: %v", code, string(data), err)
} else {
fmt.Println("restart successfully")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册