Add axum::Error (#150)

Replace `BoxStdError` and supports downcasting
This commit is contained in:
David Pedersen
2021-08-07 19:56:44 +02:00
committed by GitHub
parent 4792d0c15c
commit 75b5615ccd
12 changed files with 88 additions and 65 deletions
+6 -3
View File
@@ -1,6 +1,9 @@
//! Types and traits for generating responses.
use crate::body::{box_body, BoxBody, BoxStdError};
use crate::{
body::{box_body, BoxBody},
Error,
};
use bytes::Bytes;
use http::{header, HeaderMap, HeaderValue, Response, StatusCode};
use http_body::{
@@ -139,7 +142,7 @@ where
K: IntoResponse,
{
type Body = BoxBody;
type BodyError = BoxStdError;
type BodyError = Error;
fn into_response(self) -> Response<Self::Body> {
match self {
@@ -155,7 +158,7 @@ where
E: IntoResponse,
{
type Body = BoxBody;
type BodyError = BoxStdError;
type BodyError = Error;
fn into_response(self) -> Response<Self::Body> {
match self {