From c56b0666d44cdee8bbae2f3150afb870023fc124 Mon Sep 17 00:00:00 2001 From: Milton Mazzarri Date: Tue, 11 Jun 2019 19:30:23 -0500 Subject: [PATCH] fix credo refactor opportunity --- lib/hunter/api/http_client.ex | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/hunter/api/http_client.ex b/lib/hunter/api/http_client.ex index e9b7cbe..9f6a72d 100644 --- a/lib/hunter/api/http_client.ex +++ b/lib/hunter/api/http_client.ex @@ -341,9 +341,10 @@ defmodule Hunter.Api.HTTPClient do defp request!(url, to, method, payload, conn \\ nil) do headers = get_headers(conn) - with {:ok, body} <- Request.request(method, url, payload, headers, Config.http_options()) do - transform(body, to) - else + case Request.request(method, url, payload, headers, Config.http_options()) do + {:ok, body} -> + transform(body, to) + {:error, reason} -> raise Hunter.Error, reason: reason end