Skip to main content

Module error

Module error 

Source
Expand description

Error types and JSON error response mapping for the Aro web framework.

AroError provides a unified error type that bridges domain errors (from aro_core::error::RepoError) to HTTP responses with consistent JSON error bodies and appropriate status codes.

Actions can return Result<Json<T>, AroError> for ergonomic error handling:

async fn get_user(Path(id): Path<u64>, repo: Dep<dyn UserRepo>) -> Result<Json<User>, AroError> {
    let user = repo.find_by_id(id).await?; // RepoError -> AroError via From
    Ok(Json(user))
}

Enums§

AroError
Unified error type for Aro web actions.