-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add bang methods #83
Add bang methods #83
Conversation
…ct by default when there is an issue. add catch all for success? when params are not expected
now that I think about it..maybe the version should be bumped to |
About the version – I'll bump it to Seems reasonable overall, except you're duplicating the |
i will make changes and return the version back to what it was...sorry about that. |
@myfreeweb better? BTW, thanks for the feedback. |
Uh… almost. Except not really better. Please don't add any code duplication — Don't Repeat Yourself! (or others) I meant something like this: @doc """
Like `request`, but raises `HTTPotion.HTTPError` if failed.
"""
@spec request!(atom, String.t, [{atom(), any()}]) :: %HTTPotion.Response{} | %HTTPotion.AsyncResponse{}
def request!(method, url, options \\ []) do
case request(method, url, options) do
%HTTPotion.ErrorResponse{message: message} ->
raise HTTPotion.HTTPError, message: message
response -> response
end
end Also, the |
@myfreeweb 3rd time is a charm =] |
Looks good, thanks! |
Thank you! |
@myfreeweb could you bump the version? |
ErrorResponse
struct by default when there is an issue.Response#success?
I bumped version to
2.3.0
not sure how you would want to handle it.