Skip to content

Commit cacd976

Browse files
authored
feat: RequestError print status code (#285)
1 parent 2f008f7 commit cacd976

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

error.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,7 @@ func (e *APIError) UnmarshalJSON(data []byte) (err error) {
7070
}
7171

7272
func (e *RequestError) Error() string {
73-
if e.Err != nil {
74-
return e.Err.Error()
75-
}
76-
return fmt.Sprintf("status code %d", e.HTTPStatusCode)
73+
return fmt.Sprintf("status code %d, message: %s", e.HTTPStatusCode, e.Err)
7774
}
7875

7976
func (e *RequestError) Unwrap() error {

0 commit comments

Comments
 (0)