Fix nil pointer at error handling of cve_client #58

This commit is contained in:
kota kanbe
2016-05-16 19:23:43 +09:00
parent 0b9a1e7bb4
commit 4350ff2692

View File

@@ -133,8 +133,8 @@ 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 || resp.StatusCode != 200 {
return fmt.Errorf("HTTP GET error: %v, code: %d, url: %s", errs, resp.StatusCode, url)
if len(errs) > 0 {
return fmt.Errorf("HTTP GET error: %v, url: %s, resp: %v", errs, url, resp)
}
return nil
}