mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #4151 from crosbymichael/improve-404-client-message
Improve error message for 404 returned by daemon
This commit is contained in:
commit
6dd1bb9eb0
1 changed files with 3 additions and 1 deletions
|
@ -2118,7 +2118,9 @@ func (cli *DockerCli) call(method, path string, data interface{}, passAuthInfo b
|
|||
return nil, -1, err
|
||||
}
|
||||
|
||||
if resp.StatusCode < 200 || resp.StatusCode >= 400 {
|
||||
if resp.StatusCode == 404 {
|
||||
return nil, resp.StatusCode, fmt.Errorf("Error: request for %s returned 404 Not Found for the api version", req.URL)
|
||||
} else if resp.StatusCode < 200 || resp.StatusCode >= 400 {
|
||||
body, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return nil, -1, err
|
||||
|
|
Loading…
Add table
Reference in a new issue