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

Fix the error output when restarting Jenkins

上级 644f75fc
......@@ -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.
先完成此消息的编辑!
想要评论请 注册