remove try block from pool request
authorAlexander Strizhakov <alex.strizhakov@gmail.com>
Tue, 3 Mar 2020 14:27:56 +0000 (17:27 +0300)
committerAlexander Strizhakov <alex.strizhakov@gmail.com>
Tue, 3 Mar 2020 14:27:56 +0000 (17:27 +0300)
lib/pleroma/http/http.ex

index 4b774472e79308b4c0f770eff7b6ba972c4d4024..cc0c394007354555f76e63419f7e98fb246ff430 100644 (file)
@@ -99,23 +99,11 @@ defmodule Pleroma.HTTP do
   end
 
   def request(%Client{} = client, request, %{pool: pool, timeout: timeout}) do
-    try do
-      :poolboy.transaction(
-        pool,
-        &Pleroma.Pool.Request.execute(&1, client, request, timeout),
-        timeout
-      )
-    rescue
-      e ->
-        {:error, e}
-    catch
-      :exit, {:timeout, _} ->
-        Logger.warn("Receive response from pool failed #{request[:url]}")
-        {:error, :recv_pool_timeout}
-
-      :exit, e ->
-        {:error, e}
-    end
+    :poolboy.transaction(
+      pool,
+      &Pleroma.Pool.Request.execute(&1, client, request, timeout),
+      timeout
+    )
   end
 
   @spec request_try(Client.t(), keyword()) :: {:ok, Env.t()} | {:error, any()}