Error result of an endpoint still returns Outcome::Success #2928
-
Hi! I Have an endpoint that returns the known sensors of a network switch and I am confused about the outcome. The docs state that an Here is the endpoin:
And here is the Erorr enum:
What am I doing wrong here? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I'm not sure what docs you were reading, but according to |
Beta Was this translation helpful? Give feedback.
I'm not sure what docs you were reading, but according to
https://rocket.rs/guide/v0.5/responses/#result
,Result
just delegates the response to theOk
orErr
type. The reason the endpoint as a whole returnsOutcome::Sucess
, is because it successfully generates a response (even if that response is a 4XX or 5XX response).