Documentation
¶
Overview ¶
Package wireerror is the error contract: the typed, wavefront-originated failures returned to a client as a proper HTTP status + standard headers + the `X-Wavefront-Error` code + a fixed `wavefront.v0.Error` protobuf body. Established in v0.1 and stable through v1.0 (iterated additively). The code/ status/header table here is authoritative against docs/protocol.md.
Index ¶
- type Error
- func DecodeFailed(msg string) *Error
- func RequestBodyTooLarge(msg string) *Error
- func TransformFailedRequest(msg string) *Error
- func TransformFailedResponse(msg string) *Error
- func UnsupportedContractVersion(msg string) *Error
- func UpstreamError(msg string) *Error
- func UpstreamTimeout(msg string) *Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error is a typed, wavefront-originated failure. It satisfies the error interface so it can flow through normal Go error handling.
func DecodeFailed ¶
DecodeFailed — the client body did not decode into the contract's request_message. 400.
func RequestBodyTooLarge ¶
RequestBodyTooLarge — the inbound body exceeded WAVEFRONT_MAX_BODY_BYTES. 413.
func TransformFailedRequest ¶ added in v0.2.0
TransformFailedRequest — a request transform verb could not apply: the decoded request is well-formed but unprocessable under this contract's mapping. 422 (RFC 9110 §15.5.21).
func TransformFailedResponse ¶ added in v0.2.0
TransformFailedResponse — a response transform verb could not apply: the live internal shape drifted from the bundle's response stanzas. Same fault class as upstream_error. 502.
func UnsupportedContractVersion ¶
UnsupportedContractVersion — the contract-version header is missing, unknown, or unsupported. 400.
func UpstreamError ¶
UpstreamError — the upstream returned a non-2xx, was unreachable, or its reply could not be encoded. 502.
func UpstreamTimeout ¶
UpstreamTimeout — the upstream exceeded WAVEFRONT_REQUEST_TIMEOUT_MS. 504.
func (*Error) HTTPStatus ¶
func (*Error) Headers ¶
Headers is the standard + extension header set for this failure. Content-Type is always the protobuf media type; Retry-After is set only where retrying is semantically meaningful. The X-Wavefront-Error / X-Wavefront-Contract-Version headers are written by the server (the latter needs request context the error itself does not carry).