axum-anyhow-0.1.1 has been yanked.
axum-anyhow
A library for ergonomic error handling in Axum applications using anyhow.
This crate provides extension traits and utilities to easily convert Result and
Option types into HTTP error responses with proper status codes, titles, and
details.
Features
- Convert
anyhow::Resultto API errors with custom HTTP status codes - Convert
Optionto API errors whenNoneis encountered - Helper functions for common HTTP error codes (400, 401, 403, 404, 500)
- Automatic JSON serialization of error responses
- Seamless integration with Axum's
IntoResponsetrait
Example
use ;
use ;
use ;
async