Skip to content

Cause of 422 response #2879

Answered by fenhl
fenhl asked this question in Questions
Oct 24, 2024 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

Here's the endpoint that's failing: https://github.com/midoshouse/midos.house/blob/dee453cf71600a6ce74e4aeb50b7ccf383e40d12/src/user.rs#L293-L294

The errors are happening on the path /user/jimbo, so it's someone misunderstanding how profile pages work (my user IDs are numerical), but according to the FromParam docs, this should return 404, not 422:

If the conversion fails, the incoming request will be forwarded to the next matching route, if any.

Since there are no additional matching routes, this example will result in a 404 error for requests with invalid id values.

So maybe this is a bug in Rocket?

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@szabgab
Comment options

@fenhl
Comment options

Answer selected by the10thWiz
@the10thWiz
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants