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:
@ -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()",
|
||||
))
|
||||
|
Reference in New Issue
Block a user