| 1586 | } |
| 1587 | |
| 1588 | func (r *AbuseRateLimitError) Error() string { |
| 1589 | retryInfo := "" |
| 1590 | if r.RetryAfter != nil && *r.RetryAfter > 0 { |
| 1591 | retryInfo = fmt.Sprintf(" [retry after %v]", r.RetryAfter.Round(time.Second)) |
| 1592 | } |
| 1593 | return fmt.Sprintf("%v %v: %v %v%v", |
| 1594 | r.Response.Request.Method, sanitizeURL(r.Response.Request.URL), |
| 1595 | r.Response.StatusCode, r.Message, retryInfo) |
| 1596 | } |
| 1597 | |
| 1598 | // Is returns whether the provided error equals this error. |
| 1599 | func (r *AbuseRateLimitError) Is(target error) bool { |