| 1459 | } |
| 1460 | |
| 1461 | func (r *ErrorResponse) Error() string { |
| 1462 | if r.Response != nil && r.Response.Request != nil { |
| 1463 | return fmt.Sprintf("%v %v: %v %v %+v", |
| 1464 | r.Response.Request.Method, sanitizeURL(r.Response.Request.URL), |
| 1465 | r.Response.StatusCode, r.Message, r.Errors) |
| 1466 | } |
| 1467 | |
| 1468 | if r.Response != nil { |
| 1469 | return fmt.Sprintf("%v %v %+v", r.Response.StatusCode, r.Message, r.Errors) |
| 1470 | } |
| 1471 | |
| 1472 | return fmt.Sprintf("%v %+v", r.Message, r.Errors) |
| 1473 | } |
| 1474 | |
| 1475 | // Is returns whether the provided error equals this error. |
| 1476 | func (r *ErrorResponse) Is(target error) bool { |