From 98243db9f102627550bacbeced0f2b197a0ad51a Mon Sep 17 00:00:00 2001 From: cquintana-verbio <51116651+cquintana-verbio@users.noreply.github.com> Date: Tue, 20 Oct 2020 18:35:34 +0200 Subject: [PATCH] Print unconfigured `Data` type when attempting extraction (#1743) Co-authored-by: Rob Ede --- CHANGES.md | 2 ++ src/data.rs | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index ea77607c..b3d3c180 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,8 +2,10 @@ ## Unreleased - 2020-xx-xx * Implement Logger middleware regex exclude pattern [#1723] +* Print unconfigured `Data` type when attempting extraction. [#1743] [#1723]: https://github.com/actix/actix-web/pull/1723 +[#1743]: https://github.com/actix/actix-web/pull/1743 ## 3.1.0 - 2020-09-29 ### Changed diff --git a/src/data.rs b/src/data.rs index 6405fd90..01d36569 100644 --- a/src/data.rs +++ b/src/data.rs @@ -1,3 +1,4 @@ +use std::any::type_name; use std::ops::Deref; use std::sync::Arc; @@ -121,8 +122,9 @@ impl FromRequest for Data { } else { log::debug!( "Failed to construct App-level Data extractor. \ - Request path: {:?}", - req.path() + Request path: {:?} (type: {})", + req.path(), + type_name::(), ); err(ErrorInternalServerError( "App data is not configured, to configure use App::data()",