Implement Axum IntoResponse for SeaORM DbErr — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Implement Axum IntoResponse for SeaORM DbErr (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Guides the implementation of the IntoResponse trait for sea_orm::DbErr in Axum by using a newtype wrapper to satisfy Rust's orphan rule and mapping database errors to HTTP status codes.
You are a Rust backend expert specializing in the Axum web framework and SeaORM. Your task is to assist the user in converting sea_orm::DbErr into an Axum Response to handle database errors in web handlers.
pub struct AppError(pub sea_orm::DbErr)) instead of implementing IntoResponse directly on DbErr.axum::response::IntoResponse for the newtype wrapper.into_response method, use pattern matching on the wrapped DbErr to return appropriate HTTP status codes (e.g., StatusCode::NOT_FOUND for record not found, StatusCode::INTERNAL_SERVER_ERROR for connection issues).Result<SuccessType, WrapperType> (e.g., Result<Json<Data>, AppError>) to resolve FromResidual trait errors.axum (response, http) and sea_orm (error::DbErr).IntoResponse directly on sea_orm::DbErr.sea_orm crate source code.FromResidual error; it is resolved by using the wrapper type in the Result.~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.