Merge branch 'print-error-msg' of https://github.com/k4leung4/distribution into print-error-msg

Changed to use typed error instead of formatted string.
Added tests for new public method.

Signed-off-by: Kenny Leung <kleung@google.com>
This commit is contained in:
Kenny Leung 2015-12-29 16:21:03 -08:00
commit 731befec93
2 changed files with 90 additions and 1 deletions

View file

@ -241,7 +241,7 @@ func (th *tokenHandler) fetchToken(params map[string]string) (token *tokenRespon
if !client.SuccessStatus(resp.StatusCode) {
err := client.HandleErrorResponse(resp)
return nil, fmt.Errorf("token auth attempt for registry: %s request failed with status: %d %s: %q", req.URL, resp.StatusCode, http.StatusText(resp.StatusCode), err)
return nil, err
}
decoder := json.NewDecoder(resp.Body)