axum-errors-handling
OfficialReturn correct Axum errors without panics.
Software Engineering#error handling#thiserror#axum#anyhow#tower middleware#IntoResponse#HandleErrorLayer
AuthorImpertio-Studio
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill prevents incorrect or unsafe error handling in Axum by ensuring handlers and fallible middleware always produce valid HTTP responses with the right status codes and without leaking internal error details.
Core Features & Use Cases
- Type-system driven error responses: converts handler failures into responses by requiring
Result<T, E>whereE: IntoResponse, avoiding unwrap/expect/panic in request paths. - Structured and safe error modeling: builds an
AppErrorenum withIntoResponseplusFromimpls (optionally usingthiserror), mapping known failures to distinct status codes like 404 and 422. - Fallback and middleware adaptation: uses an
anyhowcatch-all pattern via a local newtype to keep orphan rules intact, and appliesHandleError/HandleErrorLayerfor fallibletower::Servicemiddleware such as timeouts.
Quick Start
Use this skill to design an AppError enum and implement IntoResponse and From so your Axum handler can safely use the ? operator and return the correct status and client-safe body.
Dependency Matrix
Required Modules
None requiredComponents
references
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: axum-errors-handling Download link: https://github.com/Impertio-Studio/Axum-Claude-Skill-Package/archive/main.zip#axum-errors-handling Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.