Fix error handling of httpGet in cve-client #58

This commit is contained in:
kota kanbe
2016-05-16 19:54:12 +09:00
parent c536d26db3
commit 3c85613ada

View File

@@ -133,7 +133,7 @@ func (api cvedictClient) httpGet(key, url string, resChan chan<- response, errCh
f := func() (err error) {
// resp, body, errs = gorequest.New().SetDebug(config.Conf.Debug).Get(url).End()
resp, body, errs = gorequest.New().Get(url).End()
if len(errs) > 0 {
if 0 < len(errs) || resp == nil || resp.StatusCode != 200 {
return fmt.Errorf("HTTP GET error: %v, url: %s, resp: %v", errs, url, resp)
}
return nil