Skip to content

Commit

Permalink
code review changes @coderabbitai
Browse files Browse the repository at this point in the history
  • Loading branch information
mchavez committed Jul 30, 2024
1 parent dc09d26 commit 7cb8cc0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,14 @@ func getCustomError(err error, resp *http.Response, endpointUrl string) *Jenkins
ErrorLink: endpointUrl,
}
if resp != nil {
bodyBytes, err := io.ReadAll(resp.Body)
if err != nil {
ce.ErrorSummary = fmt.Sprintf("Error reading response body %s", err.Error())
return ce
}

ce.ErrorCode = resp.StatusCode
ce.ErrorSummary = fmt.Sprint(resp.Body)
ce.ErrorSummary = string(bodyBytes)
}

return ce
Expand Down

0 comments on commit 7cb8cc0

Please sign in to comment.