Expand description
§pleme-error
Unified error handling library for Pleme platform services.
§Philosophy
This library implements Railway-Oriented Programming (Scott Wlaschin) principles:
- Errors are first-class citizens
- Railway tracks: success path vs error path
- Composable error handling
§Usage
use pleme_error::{ServiceError, Result};
fn get_user(id: &str) -> Result<User> {
let user = db.find(id)
.map_err(|e| ServiceError::database("User not found", e))?;
Ok(user)
}§Features
context- Error context and chaining with anyhowgraphql- GraphQL error conversion for async-graphqlhttp-errors- HTTP status code conversion for Axumlogging- Structured error logging with tracingdatabase- Database error conversions (sqlx, Redis)web- Full web stack (graphql + http-errors + logging)full- All features enabled
Re-exports§
pub use field_validator::FieldValidator;pub use field_validator::validation_errors_from_fields;pub use field_validator::validation_from_fields;
Modules§
- field_
validator - Multi-field validation error collection and aggregation
Enums§
- Service
Error - Unified error type for Pleme services
Type Aliases§
- Result
- Result type alias for Railway-Oriented Programming