mirror of
https://github.com/fafhrd91/actix-web
synced 2025-08-31 08:57:00 +02:00
added helper Task::error method
This commit is contained in:
17
src/error.rs
17
src/error.rs
@@ -86,6 +86,16 @@ default impl<T: StdError + Sync + Send + 'static> ErrorResponse for T {
|
||||
/// `InternalServerError` for `JsonError`
|
||||
impl ErrorResponse for JsonError {}
|
||||
|
||||
/// Return `InternalServerError` for `HttpError`,
|
||||
/// Response generation can return `HttpError`, so it is internal error
|
||||
impl ErrorResponse for HttpError {}
|
||||
|
||||
/// Return `InternalServerError` for `io::Error`
|
||||
impl ErrorResponse for IoError {}
|
||||
|
||||
/// `InternalServerError` for `InvalidHeaderValue`
|
||||
impl ErrorResponse for header::InvalidHeaderValue {}
|
||||
|
||||
/// Internal error
|
||||
#[derive(Fail, Debug)]
|
||||
#[fail(display="Unexpected task frame")]
|
||||
@@ -191,13 +201,6 @@ impl From<IoError> for PayloadError {
|
||||
}
|
||||
}
|
||||
|
||||
/// Return `InternalServerError` for `HttpError`,
|
||||
/// Response generation can return `HttpError`, so it is internal error
|
||||
impl ErrorResponse for HttpError {}
|
||||
|
||||
/// Return `InternalServerError` for `io::Error`
|
||||
impl ErrorResponse for IoError {}
|
||||
|
||||
/// Return `BadRequest` for `cookie::ParseError`
|
||||
impl ErrorResponse for cookie::ParseError {
|
||||
fn error_response(&self) -> HttpResponse {
|
||||
|
Reference in New Issue
Block a user