Expand description
Typed API errors for proper HTTP/gRPC status code mapping
Enums§
- ApiError
- API error types that can be downcast at the HTTP/gRPC boundary
- Availability
Error - Marker errors for availability endpoint failures. These are wrapped in
anyhow::Errorby the state implementation and downcasted in the Axum handlers to select the right HTTP status code. - Submit
Error - Why a node refused a transaction. Downcast by
classifyto pick the status code.
Functions§
- classify
- Errors raised as
SubmitErrororAvailabilityErrorby a state implementation carry semantic meaning; anything else is a failure the client cannot act on. Both transports classify through here, so v1 and v2 cannot drift on what counts as a 404. gRPC has no gone code, so v2 reports a 410 asnot_found. - to_
status - Render a handler error for the v2 transports: the gRPC
grpc-messagetrailer and, viatonic_rest::RestError, the REST error body. Classification and the credential scrub happen inclassifyandApiError’sDisplay, shared with the v1 path.