mirror of https://github.com/mautrix/go.git
Adjust default HTTPError stringifying
parent
b723a36ec1
commit
79af7f968a
4
error.go
4
error.go
|
@ -95,9 +95,9 @@ func (e HTTPError) Error() string {
|
|||
return fmt.Sprintf("failed to %s %s: %s (HTTP %d): %s", e.Request.Method, e.Request.URL.Path,
|
||||
e.RespError.ErrCode, e.Response.StatusCode, e.RespError.Err)
|
||||
} else {
|
||||
msg := fmt.Sprintf("failed to %s %s: %s", e.Request.Method, e.Request.URL.Path, e.Response.Status)
|
||||
msg := fmt.Sprintf("failed to %s %s: HTTP %d", e.Request.Method, e.Request.URL.Path, e.Response.StatusCode)
|
||||
if len(e.ResponseBody) > 0 {
|
||||
msg = fmt.Sprintf("%s\n%s", msg, e.ResponseBody)
|
||||
msg = fmt.Sprintf("%s: %s", msg, e.ResponseBody)
|
||||
}
|
||||
return msg
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue