fix credo refactor opportunity

master
Milton Mazzarri 2019-06-11 19:30:23 -05:00
parent 458ae161b6
commit c56b0666d4
No known key found for this signature in database
GPG Key ID: 9F4193F2B5A558FE
1 changed files with 4 additions and 3 deletions

View File

@ -341,9 +341,10 @@ defmodule Hunter.Api.HTTPClient do
defp request!(url, to, method, payload, conn \\ nil) do defp request!(url, to, method, payload, conn \\ nil) do
headers = get_headers(conn) headers = get_headers(conn)
with {:ok, body} <- Request.request(method, url, payload, headers, Config.http_options()) do case Request.request(method, url, payload, headers, Config.http_options()) do
transform(body, to) {:ok, body} ->
else transform(body, to)
{:error, reason} -> {:error, reason} ->
raise Hunter.Error, reason: reason raise Hunter.Error, reason: reason
end end