mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Merge pull request #26354 from csrwng/fix_visitor_error
Automatic merge from submit-queue kubectl: fix URLVisitor error message The status of a failed fetch will usually include the code, resulting in a duplicate code in the error message: ``` unable to read URL "http://git:8080/ruby-hello-world.git", server reported 401 401 Unauthorized ``` This change rearranges them so at least the message doesn't stutter (and includes the code in case it's not part of the status): ``` unable to read URL "http://git:8080/ruby-hello-world.git", server reported 401 Unauthorized, status code 401 ``` []()
This commit is contained in:
commit
f1ccc2f1be
@ -259,7 +259,7 @@ func readHttpWithRetries(get httpget, duration time.Duration, u string, attempts
|
||||
|
||||
// Error - Set the error condition from the StatusCode
|
||||
if statusCode != 200 {
|
||||
err = fmt.Errorf("unable to read URL %q, server reported %d %s", u, statusCode, status)
|
||||
err = fmt.Errorf("unable to read URL %q, server reported %s, status code=%d", u, status, statusCode)
|
||||
}
|
||||
|
||||
if statusCode >= 500 && statusCode < 600 {
|
||||
|
Loading…
Reference in New Issue
Block a user