mirror of
https://github.com/tokio-rs/axum.git
synced 2024-10-23 17:36:39 +02:00
put the info in the panic message
This commit is contained in:
parent
07cd3c8f4f
commit
d935c1b8fd
1 changed files with 9 additions and 4 deletions
|
@ -306,13 +306,18 @@ where
|
||||||
.remove::<SuperFallback<S, B>>()
|
.remove::<SuperFallback<S, B>>()
|
||||||
.map(|SuperFallback(path_router)| path_router.into_inner());
|
.map(|SuperFallback(path_router)| path_router.into_inner());
|
||||||
|
|
||||||
// simulate hitting `unreachable!()` below
|
|
||||||
unreachable!();
|
|
||||||
|
|
||||||
if let Some(mut super_fallback) = super_fallback {
|
if let Some(mut super_fallback) = super_fallback {
|
||||||
return super_fallback
|
return super_fallback
|
||||||
.call_with_state(req, state)
|
.call_with_state(req, state)
|
||||||
.unwrap_or_else(|_| unreachable!());
|
.unwrap_or_else(|(req, _)| {
|
||||||
|
let version = req.version();
|
||||||
|
let method = req.method();
|
||||||
|
let uri = req.uri();
|
||||||
|
let headers = req.headers();
|
||||||
|
unreachable!(
|
||||||
|
"version={version:?}; method={method:?}; uri={uri:?}; headers={headers:?}",
|
||||||
|
)
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
match self.fallback_router.call_with_state(req, state) {
|
match self.fallback_router.call_with_state(req, state) {
|
||||||
|
|
Loading…
Reference in a new issue