mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Improved error checking of 'docker pull' by printing body of HTTP error
This commit is contained in:
parent
f70bc2c98c
commit
7943a02cb6
1 changed files with 5 additions and 1 deletions
|
@ -244,7 +244,11 @@ func (graph *Graph) PushImage(stdout io.Writer, imgOrig *Image, authConfig *auth
|
|||
// FIXME: Do not be silent?
|
||||
return nil
|
||||
default:
|
||||
return fmt.Errorf("Received HTTP code %d while uploading json", res.StatusCode)
|
||||
errBody, err := ioutil.ReadAll(res.Body)
|
||||
if err != nil {
|
||||
errBody = []byte(err.Error())
|
||||
}
|
||||
return fmt.Errorf("HTTP code %d while uploading metadata: %s", res.StatusCode, errBody)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue