Expand description
Structured application error types with HTTP status mapping.
§Examples
use rskit_errors::{AppError, AppResult, ErrorCode};
fn find_user(id: &str) -> AppResult<String> {
Err(AppError::not_found("user", Some(id))
.context("find_user"))
}
let err = find_user("abc").unwrap_err();
assert_eq!(err.code(), ErrorCode::NotFound);
assert!(err.message().contains("find_user"));Re-exports§
pub use code::ErrorCode;pub use error::AppError;pub use response::ProblemDetail;pub use response::type_base_uri;pub use result::AppResult;