HttpRequestMock: Log mock errors as warnings
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Sun, 25 Aug 2019 05:10:22 +0000 (07:10 +0200)
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Sun, 25 Aug 2019 05:33:13 +0000 (07:33 +0200)
test/support/http_request_mock.ex

index 3adb5ba3baa081df7cc4721e0d0cf95893a555e8..00f4660c102d96a8b370af8aef3b91cacac00ab2 100644 (file)
@@ -17,9 +17,14 @@ defmodule HttpRequestMock do
     with {:ok, res} <- apply(__MODULE__, method, [url, query, body, headers]) do
       res
     else
-      {_, _r} = error ->
-        # Logger.warn(r)
-        error
+      error ->
+        error = error
+
+        with {:error, message} <- error do
+          Logger.warn(message)
+        end
+
+        {_, _r} = error
     end
   end