You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to know how to use the error.rs of the custom schema, specifically the function of the implementations
*impl std::fmt::Display for Error impl<'r> Responder<'r, 'static> for Error impl From<rocket::serde::json::Error<'_>> for Error
Also, I want to know if it is possible to choose which errors each endpoint returns, because as I have it now, the errors are shown for all the endpoints.
Thanks!
The text was updated successfully, but these errors were encountered:
If you want your own error just copy that code and change the errors you don't/do need. (remove/add some)
If you want 2 endpoints to have different responses you can do that by creating to structs. Lets say ServerError and FileError.
We can just add the errors we want to each endpoint by changing the error type it will return.
Also take a look at these links:
Related issue: #34
An older project (that still uses older version of Okapi): APIErrorNoContent returns 204, 400, 404 and 500. APIErrorNotModified returns 304, 400, 404 and 500.
Hope this helps you, if you have more specific questions, just ask.
Hello,
I would like to know how to use the error.rs of the custom schema, specifically the function of the implementations
*impl std::fmt::Display for Error
impl<'r> Responder<'r, 'static> for Error
impl From<rocket::serde::json::Error<'_>> for Error
Also, I want to know if it is possible to choose which errors each endpoint returns, because as I have it now, the errors are shown for all the endpoints.
Thanks!
The text was updated successfully, but these errors were encountered: