Expand description
Route-level mapping from business error payloads to HTTP statuses.
HttpErrorMapping is a route-level field, deliberately separate from
crate::error_handler::ErrorHandlerConfig: the mapping decides the
reply status of a propagated CamelError::Business, while the error
handler owns retry/dead-letter policy. A route may carry both.
Status resolution precedence (see business_status):
- explicit
codesentry (exact, case-sensitive match on the code), - explicit
kindsentry (exact, case-sensitive match on the kind), - the built-in default kind map (
default_kind_status), 500.
Values are restricted to the client/server error domain (400..=599).
Load-time validation (validate_status, validate_key, and
HttpErrorMapping::validate) rejects blank keys and out-of-domain
values. Programmatic construction can bypass that validation, so
resolution also defends: an out-of-domain entry is treated as absent and
the remaining precedence rules apply. A business error can never resolve
to a 2xx status.
Structs§
- Http
Error Mapping - Route-level business error to HTTP status mapping.
Enums§
- Http
Error Mapping Error - Typed load-time validation failure for an
HttpErrorMapping. - Mapping
Table - Which table of an
HttpErrorMappinga key belongs to.
Constants§
- DEFAULT_
BUSINESS_ STATUS - Status used when no mapping entry and no built-in default matches.
- MAX_
MAPPED_ STATUS - Highest status an error mapping entry may produce (server error).
- MIN_
MAPPED_ STATUS - Lowest status an error mapping entry may produce (client error).
Functions§
- business_
status - Resolve the reply status for a business error.
- default_
kind_ status - Built-in default status for a business error kind, if the kind is mapped.
- is_
mapped_ status - Returns
truewhenstatusis a client or server error status (400..=599), the only domain a business error may map to. - validate_
key - Reject a blank table key.
- validate_
status - Reject a status outside the client/server error domain.