What problem does it solve?
Leptos apps that mix server functions, Axum endpoints, and view components often leak internal errors or present inconsistent user-facing messages. This Skill provides a structured approach to defining AppError, mapping sqlx errors, and wiring IntoResponse and ErrorBoundary to deliver safe, consistent error handling across server and client boundaries.
Core Features & Use Cases
- AppError pattern: Domain error enum must be Clone + Serialize + Deserialize; implement FromServerFnError for server fn error framing.
- SQLx error mapping: Map RowNotFound to NotFound; map database errors to Internal with logs for debugging.
- IntoResponse integration: Implement IntoResponse for AppError to produce appropriate HTTP status codes and error bodies.
- ErrorBoundary usage: Wrap UI closures with ErrorBoundary to catch Domain errors during rendering.
- Validation pattern: Use AppError::Validation for input validation errors to return 422s with helpful messages.
Quick Start
Define AppError, implement FromServerFnError, map SQLx errors, and wire IntoResponse and ErrorBoundary in your Leptos/Axum app.