MCPcopy
hub / github.com/docker/docker-agent / StatusError

Struct StatusError

pkg/modelerrors/modelerrors.go:25–32  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

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.
25type 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
34func (e *StatusError) Error() string {
35 underlying := e.Err.Error()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected