Documentation
¶
Overview ¶
Package awshttp holds the HTTP-level plumbing shared by every doze-aws service: the API error type that stores return for API-visible failures, request-id generation, and the date formats AWS wire protocols use.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIError ¶
type APIError struct {
Code string // AWS error code, e.g. "ValidationError"
Status int // HTTP status to respond with
Message string
// SenderFault distinguishes 4xx Sender errors from Receiver faults in the
// Query/XML error envelope.
SenderFault bool
// Item optionally carries a wire-format item inside the error body —
// DynamoDB's ReturnValuesOnConditionCheckFailure.
Item json.RawMessage
// Extra merges additional members into the JSON error body (e.g.
// DynamoDB's CancellationReasons).
Extra map[string]json.RawMessage
}
APIError is a failure that maps onto an AWS API error: an error code the SDK matches on, an HTTP status, and a human message. Service stores return *APIError for anything a client should see; any other error type is treated as an internal fault (HTTP 500).
func AsAPIError ¶
AsAPIError coerces err into an *APIError, wrapping unknown error types as an opaque InternalFailure so internal details never leak onto the wire.
func AsAPIErrorOrNil ¶
AsAPIErrorOrNil is AsAPIError that passes nil through — for the common `return nil, awshttp.AsAPIErrorOrNil(err)` handler tail.