mirror of
https://github.com/actix/actix-web.git
synced 2024-12-22 08:07:18 +00:00
move ReadlinesError to error module
This commit is contained in:
parent
ad9aacf521
commit
1bee528018
2 changed files with 27 additions and 26 deletions
26
src/error.rs
26
src/error.rs
|
@ -590,6 +590,32 @@ impl From<JsonError> for JsonPayloadError {
|
|||
}
|
||||
}
|
||||
|
||||
/// Error type returned when reading body as lines.
|
||||
pub enum ReadlinesError {
|
||||
EncodingError,
|
||||
PayloadError(PayloadError),
|
||||
LimitOverflow,
|
||||
ContentTypeError(ContentTypeError),
|
||||
}
|
||||
|
||||
impl From<PayloadError> for ReadlinesError {
|
||||
fn from(err: PayloadError) -> Self {
|
||||
ReadlinesError::PayloadError(err)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Error> for ReadlinesError {
|
||||
fn from(_: Error) -> Self {
|
||||
ReadlinesError::EncodingError
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ContentTypeError> for ReadlinesError {
|
||||
fn from(err: ContentTypeError) -> Self {
|
||||
ReadlinesError::ContentTypeError(err)
|
||||
}
|
||||
}
|
||||
|
||||
/// Errors which can occur when attempting to interpret a segment string as a
|
||||
/// valid path segment.
|
||||
#[derive(Fail, Debug, PartialEq)]
|
||||
|
|
|
@ -13,7 +13,7 @@ use std::str;
|
|||
|
||||
use error::{
|
||||
ContentTypeError, HttpRangeError, ParseError, PayloadError, UrlencodedError,
|
||||
Error, ErrorBadRequest
|
||||
Error, ErrorBadRequest, ReadlinesError
|
||||
};
|
||||
use header::Header;
|
||||
use json::JsonBody;
|
||||
|
@ -394,31 +394,6 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
pub enum ReadlinesError {
|
||||
EncodingError,
|
||||
PayloadError(PayloadError),
|
||||
LimitOverflow,
|
||||
ContentTypeError(ContentTypeError),
|
||||
}
|
||||
|
||||
impl From<PayloadError> for ReadlinesError {
|
||||
fn from(err: PayloadError) -> Self {
|
||||
ReadlinesError::PayloadError(err)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Error> for ReadlinesError {
|
||||
fn from(_: Error) -> Self {
|
||||
ReadlinesError::EncodingError
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ContentTypeError> for ReadlinesError {
|
||||
fn from(err: ContentTypeError) -> Self {
|
||||
ReadlinesError::ContentTypeError(err)
|
||||
}
|
||||
}
|
||||
|
||||
/// Future that resolves to a complete http message body.
|
||||
pub struct MessageBody<T> {
|
||||
limit: usize,
|
||||
|
|
Loading…
Reference in a new issue