mirror of
https://github.com/actix/actix-web.git
synced 2024-12-29 11:30:41 +00:00
parent
593a66324f
commit
fce8dd275a
1 changed files with 8 additions and 1 deletions
|
@ -294,7 +294,14 @@ impl From<IoError> for PayloadError {
|
|||
}
|
||||
|
||||
/// `InternalServerError` for `PayloadError`
|
||||
impl ResponseError for PayloadError {}
|
||||
impl ResponseError for PayloadError {
|
||||
fn error_response(&self) -> HttpResponse {
|
||||
match *self {
|
||||
PayloadError::Overflow => HttpResponse::new(StatusCode::PAYLOAD_TOO_LARGE),
|
||||
_ => HttpResponse::new(StatusCode::BAD_REQUEST)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Return `BadRequest` for `cookie::ParseError`
|
||||
impl ResponseError for cookie::ParseError {
|
||||
|
|
Loading…
Reference in a new issue