diff --git a/broker/fastexact.go b/broker/fastexact.go index 6b7e814..7eb0ae6 100644 --- a/broker/fastexact.go +++ b/broker/fastexact.go @@ -134,7 +134,19 @@ func (fe FastExact) newRequest(state config.State) (*http.Request, 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) {