Skip to content

Commit

Permalink
Print unconfigured Data<T> type when attempting extraction (actix#1743
Browse files Browse the repository at this point in the history
)

Co-authored-by: Rob Ede <[email protected]>
  • Loading branch information
cquintana-verbio and robjtede authored Oct 20, 2020
1 parent f92742b commit 98243db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

## Unreleased - 2020-xx-xx
* 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
[#1743]: https://github.com/actix/actix-web/pull/1743

## 3.1.0 - 2020-09-29
### Changed
Expand Down
6 changes: 4 additions & 2 deletions src/data.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::any::type_name;
use std::ops::Deref;
use std::sync::Arc;

Expand Down Expand Up @@ -121,8 +122,9 @@ impl<T: ?Sized + 'static> FromRequest for Data<T> {
} else {
log::debug!(
"Failed to construct App-level Data extractor. \
Request path: {:?}",
req.path()
Request path: {:?} (type: {})",
req.path(),
type_name::<T>(),
);
err(ErrorInternalServerError(
"App data is not configured, to configure use App::data()",
Expand Down

0 comments on commit 98243db

Please sign in to comment.