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
Response::error("Error", 200) is perfectly valid and is not correct at all.
Actually, looking at the implementation it would be fine if we just renamed this to Response::with_status. @nilslice what do you think? We could still have Response::internal_error or Response::request_error convenience wrappers if you think they're helpful.
(This may become a moot point after implementing #13.)
The text was updated successfully, but these errors were encountered:
Yea I think renaming this to Response::with_status is fine. I like having an error method though for spot-checking code, making it really easy to know immediately that a certain branch is returning a failure indicator.
Feel free to rename, and if you want to, we could add a Response::error method which verifies that the code is within a true-to-spec error range. 400 - 599 would be a good start.
For now I've updated Response::error so it is only valid for error-related status codes. Adding a with_status method is a good idea too and I will probably include it along with some other clean-up work.
Response::error("Error", 200)
is perfectly valid and is not correct at all.Actually, looking at the implementation it would be fine if we just renamed this to
Response::with_status
. @nilslice what do you think? We could still haveResponse::internal_error
orResponse::request_error
convenience wrappers if you think they're helpful.(This may become a moot point after implementing #13.)
The text was updated successfully, but these errors were encountered: