I'm having difficulty connecting to an enterprise Jenkins instance, and can't troubleshoot whether my credentials are invalid or unauthorized, since Jenkins.Init() doesn't tell me the status code, just that it failed.
Suggested change:
j.Version = rsp.Header.Get("X-Jenkins")
if j.Raw == nil || rsp.StatusCode != http.StatusOK {
return nil, errors.New(fmt.Sprintf("Connection Failed, please verify that the host and credentials are correct. Status Code %d", rsp.StatusCode))
}
I'm having difficulty connecting to an enterprise Jenkins instance, and can't troubleshoot whether my credentials are invalid or unauthorized, since
Jenkins.Init()
doesn't tell me the status code, just that it failed.Suggested change:
Previously suggested by @vperson in https://github.com/bndr/gojenkins/issues/210#issuecomment-808831117