What would have been the easiest way to realize I have to pass Query params to a handler? #2052
-
So I have a handler like pub async fn ws_handler(
ws: WebSocketUpgrade,
Query(params): Query<Params>,
State(state): State<Arc<Context>>,
) -> AxumResponse {
...
} and I spend a good while debugging why it didn't work as I copy-pasted it from a project to another. Until I figured out that I wasn't passing the JWT as I did originally I added some tracing with tower which just showed a 400 response. Was there an easy way to realize this before I wasted time fiddling about? Or is this just one of those things that you just should know beforehand? To me it wasn't obvious but I guess tower showing a response of 400 should have rung some bells. Oh well, hopefully this helps someone else in the future. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The response body would have told you. You can also enable tracing to built in extractors like documented here https://docs.rs/axum/latest/axum/extract/index.html#logging-rejections |
Beta Was this translation helpful? Give feedback.
The response body would have told you. You can also enable tracing to built in extractors like documented here https://docs.rs/axum/latest/axum/extract/index.html#logging-rejections