diff --git a/basic_client.go b/basic_client.go index 4abaf21..c327ae5 100644 --- a/basic_client.go +++ b/basic_client.go @@ -74,7 +74,7 @@ func (c *BasicClient) RawRequest(URL string, r io.Reader) (*http.Response, error } if response.StatusCode != 200 { - return nil, errors.New("OFXQuery request status: " + response.Status) + return response, errors.New("OFXQuery request status: " + response.Status) } return response, nil diff --git a/vanguard_client.go b/vanguard_client.go index 4728d5f..e367259 100644 --- a/vanguard_client.go +++ b/vanguard_client.go @@ -64,7 +64,7 @@ func (c *VanguardClient) RequestNoParse(r *Request) (*http.Response, error) { // Fortunately, the initial response contains the cookie we need, so if we // detect an empty response with cookies set that didn't have any errors, // re-try the request while sending their cookies back to them. - if err == nil && response.ContentLength <= 0 && len(response.Cookies()) > 0 { + if response != nil && response.ContentLength <= 0 && len(response.Cookies()) > 0 { b, err = r.Marshal() if err != nil { return nil, err