Skip to content

How to catch "Invalid URL param." error? #333

Answered by davidpdrsn
shengsheng asked this question in Q&A
Discussion options

You must be logged in to vote

Use Result<Path<...>, PathParamsRejection> as the extractor which allows you to handle errors.

You can find an example here https://docs.rs/axum/0.2.4/axum/extract/index.html#optional-extractors.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@kyle-mccarthy
Comment options

@davidpdrsn
Comment options

Answer selected by davidpdrsn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants