1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-08-31 08:57:00 +02:00

rename PathPayloadError and test for path config

This commit is contained in:
Nikolay Kim
2019-06-12 17:02:45 +06:00
parent 13e618b128
commit e7ba67e1a8
3 changed files with 59 additions and 41 deletions

View File

@@ -94,19 +94,17 @@ impl ResponseError for JsonPayloadError {
/// A set of errors that can occur during parsing request paths
#[derive(Debug, Display, From)]
pub enum PathPayloadError {
pub enum PathError {
/// Deserialize error
#[display(fmt = "Path deserialize error: {}", _0)]
Deserialize(de::Error),
}
/// Return `BadRequest` for `PathPayloadError`
impl ResponseError for PathPayloadError {
/// Return `BadRequest` for `PathError`
impl ResponseError for PathError {
fn error_response(&self) -> HttpResponse {
match *self {
PathPayloadError::Deserialize(_) => {
HttpResponse::new(StatusCode::BAD_REQUEST)
}
PathError::Deserialize(_) => HttpResponse::new(StatusCode::BAD_REQUEST),
}
}
}