Skip to content

Commit

Permalink
feat: RequestError print status code (sashabaranov#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
liushuangls authored Apr 30, 2023
1 parent 2f008f7 commit cacd976
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions error.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@ func (e *APIError) UnmarshalJSON(data []byte) (err error) {
}

func (e *RequestError) Error() string {
if e.Err != nil {
return e.Err.Error()
}
return fmt.Sprintf("status code %d", e.HTTPStatusCode)
return fmt.Sprintf("status code %d, message: %s", e.HTTPStatusCode, e.Err)
}

func (e *RequestError) Unwrap() error {
Expand Down

0 comments on commit cacd976

Please sign in to comment.