1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-26 02:19:22 +02:00

simplify http response construction; deprecate httpcodes

This commit is contained in:
Nikolay Kim
2018-03-30 23:07:33 -07:00
parent 8d8f6bedad
commit 44e3df82f6
58 changed files with 561 additions and 539 deletions

View File

@ -13,10 +13,8 @@ pub use self::connector::{Connect, Connection, ClientConnector, ClientConnectorE
pub(crate) use self::writer::HttpClientWriter;
pub(crate) use self::parser::{HttpResponseParser, HttpResponseParserError};
use httpcodes;
use httpresponse::HttpResponse;
use error::ResponseError;
use httpresponse::HttpResponse;
/// Convert `SendRequestError` to a `HttpResponse`
@ -24,8 +22,9 @@ impl ResponseError for SendRequestError {
fn error_response(&self) -> HttpResponse {
match *self {
SendRequestError::Connector(_) => httpcodes::HttpBadGateway.into(),
_ => httpcodes::HttpInternalServerError.into(),
SendRequestError::Connector(_) => HttpResponse::BadGateway(),
_ => HttpResponse::InternalServerError(),
}
.into()
}
}