equal
deleted
inserted
replaced
128 res, err := c.MakeRequest(req) |
128 res, err := c.MakeRequest(req) |
129 if err != nil { |
129 if err != nil { |
130 return nil, err |
130 return nil, err |
131 } |
131 } |
132 if res.StatusCode < 200 || res.StatusCode >= 300 { |
132 if res.StatusCode < 200 || res.StatusCode >= 300 { |
133 return nil, errors.Errorf("bad server status code (%d): %s", |
133 // Please note that the error string code is used by Search() |
|
134 // to check the error cause. |
|
135 const errFormatString = "bad server status code (%d)" |
|
136 return nil, errors.Errorf(errFormatString+": %s", |
134 res.StatusCode, http.StatusText(res.StatusCode)) |
137 res.StatusCode, http.StatusText(res.StatusCode)) |
135 } |
138 } |
136 |
139 |
137 // Build Response object. |
140 // Build Response object. |
138 response, err := rest.BuildResponse(res) |
141 response, err := rest.BuildResponse(res) |