Skip to main content

Module api_error

Module api_error 

Source
Expand description

ApiError — the single error type that every distri service returns.

Variants map cleanly to HTTP status codes. Routes return Result<HttpResponse, ApiError>; the ResponseError impl lives in distri-server (where the actix dependency lives) and renders every variant as {"error": "<message>"} JSON with the appropriate status.

Store calls return anyhow::Result<T>; the #[from] anyhow::Error conversion lets services ? straight through, surfacing unexpected errors as ApiError::Internal (logged + 500). Business decisions (validation failures, “not found”, “this is forbidden”) explicitly return the typed variant — no string-parsing at the boundary.

Enums§

ApiError

Type Aliases§

ApiResult