From 0a7647680f91108767abd532ad9fcdb4c92cf5bf Mon Sep 17 00:00:00 2001 From: Jordan Bracco Date: Thu, 2 Mar 2023 16:54:22 +0100 Subject: Couch fix --- lib/couch.ex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/couch.ex b/lib/couch.ex index a4cf811..59ffd93 100644 --- a/lib/couch.ex +++ b/lib/couch.ex @@ -76,7 +76,7 @@ defmodule Couch do path = path |> Enum.filter(& &1) - |> Enum.map(fn(url) -> String.replace("/", "%2F") end) + |> Enum.map(fn(part) -> String.replace(part, "/", "%2F") end) |> Path.join() url = base_url @@ -98,7 +98,7 @@ defmodule Couch do {url, headers, options} end - defp handle_generic_response(%HTTPoison.Response{status_code: code}), do: {:error, Plug.Conn.Status.reason_atom(code)} - defp handle_generic_response(%HTTPoison.Error{reason: reason}), do: {:error, reason} + defp handle_generic_response({:ok, %HTTPoison.Response{status_code: code}}), do: {:error, Plug.Conn.Status.reason_atom(code)} + defp handle_generic_response({:error, %HTTPoison.Error{reason: reason}}), do: {:error, reason} end -- cgit v1.2.3