StatusError wraps an HTTP API error with structured metadata for retry decisions. Providers wrap SDK errors in this type so the retry loop can use errors.As to extract status code and Retry-After without importing provider-specific SDKs.
| 23 | // Providers wrap SDK errors in this type so the retry loop can use errors.As |
| 24 | // to extract status code and Retry-After without importing provider-specific SDKs. |
| 25 | type StatusError struct { |
| 26 | // StatusCode is the HTTP status code from the provider's API response. |
| 27 | StatusCode int |
| 28 | // RetryAfter is the parsed Retry-After header duration. Zero if absent. |
| 29 | RetryAfter time.Duration |
| 30 | // Err is the original error from the provider SDK. |
| 31 | Err error |
| 32 | } |
| 33 | |
| 34 | func (e *StatusError) Error() string { |
| 35 | underlying := e.Err.Error() |
nothing calls this directly
no outgoing calls
no test coverage detected