feat: RequestError print status code (#285)
This commit is contained in:
1 parent
2f008f7054
commit
cacd976a0c
1 file changed
+1
-4
@@ -70,10 +70,7 @@ func (e *APIError) UnmarshalJSON(data []byte) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (e *RequestError) Error() string {
|
func (e *RequestError) Error() string {
|
||||||
if e.Err != nil {
|
return fmt.Sprintf("status code %d, message: %s", e.HTTPStatusCode, e.Err)
|
||||||
return e.Err.Error()
|
|
||||||
}
|
|
||||||
return fmt.Sprintf("status code %d", e.HTTPStatusCode)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *RequestError) Unwrap() error {
|
func (e *RequestError) Unwrap() error {
|
||||||
|
|||||||
Reference in new issue
Block a user