Skip to content

Commit

Permalink
Merge pull request #1123 from stripe/bryan-fix-lastresponse
Browse files Browse the repository at this point in the history
Attach LastResponse after unmarshaling
  • Loading branch information
remi-stripe authored Jun 11, 2020
2 parents ca7b123 + f3da983 commit bfa3225
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions stripe.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,13 +505,10 @@ func (s *BackendImplementation) Do(req *http.Request, body *bytes.Buffer, v Last

s.LeveledLogger.Debugf("Response: %s", string(resBody))

err = s.UnmarshalJSONVerbose(res.StatusCode, resBody, v)
v.SetLastResponse(newAPIResponse(res, resBody))

if v != nil {
return s.UnmarshalJSONVerbose(res.StatusCode, resBody, v)
}

return nil
return err
}

// ResponseToError converts a stripe response to an Error.
Expand Down

0 comments on commit bfa3225

Please sign in to comment.