Skip to content

Commit 65b6793

Browse files
davidpdrsnnpmccallum
authored andcommitted
Rename Error to ErrorResponse
1 parent 400cdc3 commit 65b6793

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

axum-core/src/response/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub type Response<T = BoxBody> = http::Response<T>;
2222

2323
/// A flexible [IntoResponse]-based result type
2424
///
25-
/// All types which implement [IntoResponse] can be converted to an [Error].
25+
/// All types which implement [IntoResponse] can be converted to an [ErrorResponse].
2626
/// This makes it useful as a general error type for functions which combine
2727
/// multiple distinct error types but all of which implement [IntoResponse].
2828
///
@@ -42,7 +42,7 @@ pub type Response<T = BoxBody> = http::Response<T>;
4242
/// Ok("ok")
4343
/// }
4444
/// ```
45-
pub type Result<T, E = Error> = std::result::Result<T, E>;
45+
pub type Result<T> = std::result::Result<T, ErrorResponse>;
4646

4747
impl<T> IntoResponse for Result<T>
4848
where
@@ -60,9 +60,9 @@ where
6060
///
6161
/// See [Result] for more details.
6262
#[derive(Debug)]
63-
pub struct Error(Response);
63+
pub struct ErrorResponse(Response);
6464

65-
impl<T> From<T> for Error
65+
impl<T> From<T> for ErrorResponse
6666
where
6767
T: IntoResponse,
6868
{

axum/src/response/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub use crate::Extension;
2020

2121
#[doc(inline)]
2222
pub use axum_core::response::{
23-
AppendHeaders, Error, IntoResponse, IntoResponseParts, Response, ResponseParts, Result,
23+
AppendHeaders, ErrorResponse, IntoResponse, IntoResponseParts, Response, ResponseParts, Result,
2424
};
2525

2626
#[doc(inline)]

0 commit comments

Comments
 (0)