mirror of
https://github.com/actix/actix-web.git
synced 2025-01-04 22:38:44 +00:00
Print unconfigured Data<T>
type when attempting extraction (#1743)
Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
parent
f92742bdac
commit
98243db9f1
2 changed files with 6 additions and 2 deletions
|
@ -2,8 +2,10 @@
|
||||||
|
|
||||||
## Unreleased - 2020-xx-xx
|
## Unreleased - 2020-xx-xx
|
||||||
* Implement Logger middleware regex exclude pattern [#1723]
|
* Implement Logger middleware regex exclude pattern [#1723]
|
||||||
|
* Print unconfigured `Data<T>` type when attempting extraction. [#1743]
|
||||||
|
|
||||||
[#1723]: https://github.com/actix/actix-web/pull/1723
|
[#1723]: https://github.com/actix/actix-web/pull/1723
|
||||||
|
[#1743]: https://github.com/actix/actix-web/pull/1743
|
||||||
|
|
||||||
## 3.1.0 - 2020-09-29
|
## 3.1.0 - 2020-09-29
|
||||||
### Changed
|
### Changed
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
use std::any::type_name;
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
@ -121,8 +122,9 @@ impl<T: ?Sized + 'static> FromRequest for Data<T> {
|
||||||
} else {
|
} else {
|
||||||
log::debug!(
|
log::debug!(
|
||||||
"Failed to construct App-level Data extractor. \
|
"Failed to construct App-level Data extractor. \
|
||||||
Request path: {:?}",
|
Request path: {:?} (type: {})",
|
||||||
req.path()
|
req.path(),
|
||||||
|
type_name::<T>(),
|
||||||
);
|
);
|
||||||
err(ErrorInternalServerError(
|
err(ErrorInternalServerError(
|
||||||
"App data is not configured, to configure use App::data()",
|
"App data is not configured, to configure use App::data()",
|
||||||
|
|
Loading…
Reference in a new issue