Expand description
Core error types for the rok ecosystem.
Consolidates RokError (unified application error) and Problem
(RFC 9457 problem details) into a single crate. The original rok-error
and rok-problem crates are kept as deprecated shim re-exports.
§Feature flags
| Feature | Enables |
|---|---|
axum | IntoResponse for RokError and Problem |
§Example
ⓘ
use rok_core::{RokError, Problem};
use axum::{Json, extract::Path};
async fn get_user(Path(id): Path<i64>) -> Result<Json<User>, RokError> {
let user = User::find_or_fail(&pool, id).await?;
Ok(Json(user))
}Re-exports§
pub use error::RokError;pub use error::RokException;pub use problem::Problem;
Modules§
Macros§
- rok_
exception - Define a typed exception struct implementing
RokException.