Improve error for missing extension (#795)

This commit is contained in:
David Pedersen 2022-02-25 19:42:36 +01:00 committed by GitHub
parent e2dc6b3147
commit 8175b9108f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -56,7 +56,7 @@ where
.get::<T>() .get::<T>()
.ok_or_else(|| { .ok_or_else(|| {
MissingExtension::from_err(format!( MissingExtension::from_err(format!(
"Extension of type `{}` was not found. Perhaps you forgot to add it?", "Extension of type `{}` was not found. Perhaps you forgot to add it? See `axum::AddExtensionLayer`.",
std::any::type_name::<T>() std::any::type_name::<T>()
)) ))
}) })