Skip to content

Error Flow

This page explains how internal failures become compact client-facing HTTP or SSE errors.

Internal error
RequestError / ConfigError / UpstreamError / TranslationError / SseError / ByteStreamError
Classify
Select stable client-facing error type and status
Preserve safe details
Keep useful upstream headers without leaking private data
Render
HTTP body or SSE error event depending on response state
Client error
text or JSON ErrorResponseSpec
Error familyUse for
RequestErrorInbound body parsing and client request validation failures.
ConfigErrorConfig loading, config-file reads, route/provider validation, and startup config failures.
InternalErrorProxy runtime invariants, local filesystem IO, body reads, serialization, and boundary failures.
UpstreamErrorProvider send failures, non-success statuses, and upstream body-read failures.
TranslationErrorProtocol payload conversion failures.
SseError / SseTranslationErrorSSE event semantics and streaming conversion failures.
ByteStreamErrorByte stream carrier failures.
RuleReason
Do not expose internal taxonomy verbatimClient-facing types should be stable and compact.
Always include numeric status in payloadSSE error events cannot change HTTP status after streaming starts.
Preserve useful upstream diagnostic headers when presentRetry-After, upstream request ids, and rate-limit headers help debugging.
Do not fabricate upstream code or paramThose values only exist when the upstream provided them.
Do not log private request bodies or Authorization headersErrors must remain privacy-safe by default.
CarrierBehavior
HTTP before response startsRender normal HTTP error with configured text or JSON payload.
SSE after stream startsRender protocol-compatible error event where possible; include payload status.
Upstream non-2xxProject upstream failure into configured client-facing error format and safe preserved headers.
Stream semantic failureEmit/return an error that distinguishes incomplete terminal semantics from normal completion.
ConcernOwner
Domain error taxonomysrc/error/
SSE semantic failuressrc/sse.rs and streaming translation modules
Byte stream carrierssrc/http_support/
Proxy request lifecyclesrc/lib.rs and pipeline modules