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

let Path::from_request() fail with ErrorNotFound

This commit is contained in:
Niklas Fiekas
2018-05-08 22:45:28 +02:00
parent b3cc43bb9b
commit 6f75b0e95e
2 changed files with 4 additions and 2 deletions

View File

@ -11,7 +11,7 @@ use serde::de::{self, DeserializeOwned};
use serde_urlencoded;
use de::PathDeserializer;
use error::{Error, ErrorBadRequest};
use error::{Error, ErrorNotFound, ErrorBadRequest};
use handler::{AsyncResult, FromRequest};
use httpmessage::{HttpMessage, MessageBody, UrlEncoded};
use httprequest::HttpRequest;
@ -108,7 +108,7 @@ where
fn from_request(req: &HttpRequest<S>, _: &Self::Config) -> Self::Result {
let req = req.clone();
de::Deserialize::deserialize(PathDeserializer::new(&req))
.map_err(|e| e.into())
.map_err(ErrorNotFound)
.map(|inner| Path { inner })
}
}