Expand description
The framework error type.
Every Rainier component fails with the same Error, and every Error
carries the two things the HTTP layer needs to render it without knowing
where it came from: an ErrorKind that maps to a status code, and an
optional structured details payload.
That is what keeps the crate graph acyclic. rainier-validation cannot
add a Validation variant to an enum in rainier-support (that would be a
cycle), so instead it builds Error::validation(details) and the exception
handler in rainier-http renders details as JSON. The same trick serves
auth, authorization, and model-not-found — no component needs to know the
others’ error types.
Structs§
- Error
- A framework error: a
kind, a human message, an optional structureddetailspayload, and an optional underlying cause.
Enums§
- Error
Kind - The class of failure, which is also the HTTP status it renders as.
Traits§
- Context
- Adds
.context(..)to anyResultwhose error converts intoError, the wayanyhow::Contextdoes — but preserving theErrorKindwhen the error already is a Rainier error, so adding context to a 404 does not silently turn it into a 500.
Type Aliases§
- Result
- The framework result type.