Skip to content
This repository has been archived by the owner on Feb 5, 2025. It is now read-only.

Commit

Permalink
Merge pull request #13 from tuckner/error-handling
Browse files Browse the repository at this point in the history
handle errors better
  • Loading branch information
tuckner authored Dec 21, 2021
2 parents fc35c36 + a6cc5d8 commit a914cf7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tines/tines.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,11 @@ func CheckResponse(r *http.Response, req *http.Request) error {
}

reqbuf := new(bytes.Buffer)
reqbuf.ReadFrom(req.Body)
reqbody := reqbuf.String()
var reqbody = ""
if req.Body != nil {
reqbuf.ReadFrom(req.Body)
reqbody = reqbuf.String()
}

resbuf := new(bytes.Buffer)
resbuf.ReadFrom(r.Body)
Expand Down

0 comments on commit a914cf7

Please sign in to comment.