Skip to content

Commit

Permalink
Log error too
Browse files Browse the repository at this point in the history
  • Loading branch information
Travis Ralston committed Mar 6, 2024
1 parent e50fbb4 commit a37b819
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions amember/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ func doRequest[R any](endpoint string, query url.Values) (R, error) {

return val, nil
} else {
b, err := io.ReadAll(res.Body)
if err != nil {
return zero, err
}
log.Println("aMember Pro error: ", string(b))

return zero, fmt.Errorf("http error %d %s", res.StatusCode, res.Status)
}
}

0 comments on commit a37b819

Please sign in to comment.