feat: RequestError print status code (#285)

This commit is contained in:
Liu Shuang
2023-05-01 05:18:43 +08:00
committed by GitHub
parent 2f008f7054
commit cacd976a0c

View File

@@ -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 {