1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-07-01 08:45:10 +02:00

added some error logging for extractors: Data, Json, Query, and Path (#765)

* added some error logging for extractors

* changed log::error to log::debug and fixed position of log for path

* added request path to debug logs
This commit is contained in:
Darin
2019-04-10 15:45:13 -04:00
committed by Nikolay Kim
parent 9d82d4dfb9
commit 6ab9838977
3 changed files with 12 additions and 1 deletions

View File

@ -96,6 +96,8 @@ impl<T: 'static, P> FromRequest<P> for Data<T> {
if let Some(st) = req.app_config().extensions().get::<Data<T>>() {
Ok(st.clone())
} else {
log::debug!("Failed to construct App-level Data extractor. \
Request path: {:?}", req.path());
Err(ErrorInternalServerError(
"App data is not configured, to configure use App::data()",
))
@ -235,6 +237,7 @@ impl<T: 'static, P> FromRequest<P> for RouteData<T> {
if let Some(st) = req.route_data::<T>() {
Ok(st.clone())
} else {
log::debug!("Failed to construct Route-level Data extractor");
Err(ErrorInternalServerError(
"Route data is not configured, to configure use Route::data()",
))