Skip to content

Commit 79af7f9

Browse files
committed
Adjust default HTTPError stringifying
1 parent b723a36 commit 79af7f9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

error.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ func (e HTTPError) Error() string {
9595
return fmt.Sprintf("failed to %s %s: %s (HTTP %d): %s", e.Request.Method, e.Request.URL.Path,
9696
e.RespError.ErrCode, e.Response.StatusCode, e.RespError.Err)
9797
} else {
98-
msg := fmt.Sprintf("failed to %s %s: %s", e.Request.Method, e.Request.URL.Path, e.Response.Status)
98+
msg := fmt.Sprintf("failed to %s %s: HTTP %d", e.Request.Method, e.Request.URL.Path, e.Response.StatusCode)
9999
if len(e.ResponseBody) > 0 {
100-
msg = fmt.Sprintf("%s\n%s", msg, e.ResponseBody)
100+
msg = fmt.Sprintf("%s: %s", msg, e.ResponseBody)
101101
}
102102
return msg
103103
}

0 commit comments

Comments
 (0)