From 9f5184c1116760716f33ba69345567ac33b2ea94 Mon Sep 17 00:00:00 2001 From: Derek McGowan Date: Sun, 22 Mar 2015 18:15:18 -0700 Subject: [PATCH] Add check for 404 on get repository data No longer add the body to the error when a 404 is received on get repository data. closes #11510 Signed-off-by: Derek McGowan (github: dmcgowan) --- docs/session.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/session.go b/docs/session.go index 470aeab4c..82338252e 100644 --- a/docs/session.go +++ b/docs/session.go @@ -280,7 +280,9 @@ func (r *Session) GetRepositoryData(remote string) (*RepositoryData, error) { } // TODO: Right now we're ignoring checksums in the response body. // In the future, we need to use them to check image validity. - if res.StatusCode != 200 { + if res.StatusCode == 404 { + return nil, utils.NewHTTPRequestError(fmt.Sprintf("HTTP code: %d", res.StatusCode), res) + } else if res.StatusCode != 200 { errBody, err := ioutil.ReadAll(res.Body) if err != nil { log.Debugf("Error reading response body: %s", err)