Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsConflict ¶
IsConflict reports whether err represents a sync conflict.
func IsRetryableStatus ¶ added in v0.6.0
IsRetryableStatus reports whether an HTTP status code is worth a retry: 408 (request timeout), 425 (too early), 429 (too many requests), or any 5xx. It is the single source of truth shared by IsTransient and the CalDAV client.
func IsTransient ¶
IsTransient reports whether err is worth a retry.
Types ¶
type HTTPError ¶ added in v0.6.0
type HTTPError struct {
Status int
// Err holds the underlying error (typically a formatted message with
// the status text and a body excerpt). It is preserved for Error and
// Unwrap so existing message-based diagnostics keep working.
Err error
}
HTTPError carries an HTTP status code as a typed field. Transient and conflict classification can then rely on the real status instead of a scrape of the error string. String scrape is fragile. Any wrap that prepends a numeric token (a batch index, a host:port segment) would shadow the status and mis-route retries.
func NewHTTPError ¶ added in v0.6.0
NewHTTPError builds an HTTPError for the given status. The message is supplied by the caller so the rich, human-readable form is preserved.
type RetryOptions ¶
RetryOptions controls retry behavior for transient network operations.
type TransientError ¶ added in v0.6.0
TransientError marks an error as retryable. It optionally carries a server-requested minimum delay before the next attempt. One example is the value of an HTTP Retry-After header on a 429 or 503 response. A zero RetryAfter means the server gave no hint. Normal exponential backoff then applies.
func (*TransientError) Error ¶ added in v0.6.0
func (e *TransientError) Error() string
func (*TransientError) Unwrap ¶ added in v0.6.0
func (e *TransientError) Unwrap() error