parent
9427e85202
commit
0ab4b795bd
|
|
@ -134,7 +134,19 @@ func (fe FastExact) newRequest(state config.State) (*http.Request, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fe FastExact) doRequest(req *http.Request) (*http.Response, error) {
|
func (fe FastExact) doRequest(req *http.Request) (*http.Response, error) {
|
||||||
return do(req)
|
resp, err := do(req)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if resp.StatusCode != http.StatusOK {
|
||||||
|
b, _ := ioutil.ReadAll(resp.Body)
|
||||||
|
logtr.Errorf("fastExact bad status: %d: %s", resp.StatusCode, b)
|
||||||
|
if resp.StatusCode > 400 && resp.StatusCode < 404 {
|
||||||
|
return nil, ErrNoAuth
|
||||||
|
}
|
||||||
|
return nil, fmt.Errorf("bad status from FastExact: %d: %s", resp.StatusCode, b)
|
||||||
|
}
|
||||||
|
return resp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fe FastExact) parse(resp *http.Response) ([]Job, error) {
|
func (fe FastExact) parse(resp *http.Response) ([]Job, error) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue