Skip to content

Commit

Permalink
fix: read error message when get a 500 error
Browse files Browse the repository at this point in the history
  • Loading branch information
minchao committed Apr 27, 2024
1 parent abfc56d commit e1a90bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cwb/cwb.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func checkResponse(r *http.Response) error {

errorResponse := &ErrorResponse{Response: r, Message: "unknown"}
switch r.StatusCode {
case http.StatusUnauthorized, http.StatusNotFound:
case http.StatusUnauthorized, http.StatusNotFound, http.StatusInternalServerError:
data, err := ioutil.ReadAll(r.Body)
if err != nil {
errorResponse.Message = fmt.Sprintf("reading body, %s", err.Error())
Expand Down

0 comments on commit e1a90bf

Please sign in to comment.