Skip to content

Commit

Permalink
Print statements ftw
Browse files Browse the repository at this point in the history
  • Loading branch information
Zorlin committed Mar 22, 2024
1 parent 039a2a8 commit 1f14046
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/http/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,12 +361,15 @@ func PostRequestBuffer[ResultType any](
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
// Print a debug line with the response body.
log.Debug().Msgf("[debug] error while reading. response body: %s", body)
return result, err
}

// parse body as json into result
err = json.Unmarshal(body, &result)
if err != nil {
log.Debug().Msgf("[debug] error while unmarshaling. response body: %s", body)
return result, err
}

Expand Down

0 comments on commit 1f14046

Please sign in to comment.