-
Hi, is there a way to get the original path parameter value (String) that failed to parse and caused a PathParamRejection? Alternatively, would it be possible to expose the error type from the path parameter parser? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Not quite sure I understand. Can you elaborate? |
Beta Was this translation helpful? Give feedback.
-
Certainly, suppose I have a few path parameters:
To handle parse errors myself, I can wrap the extractor in E.g., I would like to get the name of the failed parameter (alone, not in a formatted description) and the expected type. Or maybe I'm not looking in the right place? |
Beta Was this translation helpful? Give feedback.
Certainly, suppose I have a few path parameters:
/prefix/:param1/infix/:param2
and a handler that accepts them:To handle parse errors myself, I can wrap the extractor in
Result<Path<...>, PathParamsRejection>
but even if do, PathParamsRejection doesn't really tell me which parameter failed and why -- I mean there's a description of the error, but the error itself doesn't give more details like e.g., serde_json::de::Error would.E.g., I would like to get the name of the failed parameter (alone, not in a formatted description) and the expected type.
Or maybe I'm not looking in the right place?