Middleware error: Service<axum::http::Request<axum::body::Body>> is not satisfied #2549
Unanswered
shengsheng
asked this question in
Q&A
Replies: 1 comment 1 reply
-
The issue is that you're not using any fallible middleware so there are no errors to handle with |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
error[E0277]
: the trait boundHandleError<ConcurrencyLimit<tower_http::trace::Trace<Route, SharedClassifier<ServerErrorsAsFailures>>>, fn(Box<(dyn StdError + Send + Sync + 'static)>) -> impl Future<Output = impl axum::IntoResponse> {app::handle_error}, _>: Service<axum::http::Request<axum::body::Body>>
is not satisfiedIf I add
.load_shed()
beforeconcurrency_limit()
, the error disappears.I presume this is because
load_shed()
returns an error, whileconcurrency_limit()
does not.My Question are:
Service<axum::http::Request<axum::body::Body>>
is not satisfied" mean in this context? Why report this error?My question actually stems from the situation below. I presume that the error output below and the above error are caused by the same issue:
When I test the crate
axum-login
oauth2 example,https://github.com/maxcountryman/axum-login/blob/v0.13.1/examples/oauth2/src/web/app.rs#L61-L65
Code in examples/oauth2/src/web/app.rs#L61-L65:
When following the axum document's suggestion to apply multiple middleware at once, I moved
auth_layer
intoServiceBuilder
:Output:
axum version
0.7.4
Beta Was this translation helpful? Give feedback.
All reactions