axum icon indicating copy to clipboard operation
axum copied to clipboard

WIP: Allow querying of HTTP status codes for query and form rejections

Open htrefil opened this issue 8 months ago • 0 comments

Motivation

axum_extra::{query::QueryRejection, form::FormRejection} are missing a method that would allow users to query the status code without converting it into a response via IntoResponse first.

This is useful when one wants to customize rejection responses.

Solution

Add pub fn status(&self) -> http::StatusCode methods to both rejections.

htrefil avatar Jun 10 '24 18:06 htrefil