diff options
author | Hubert Chathi <hubert@uhoreg.ca> | 2020-05-09 11:03:08 -0400 |
---|---|---|
committer | Hubert Chathi <hubert@uhoreg.ca> | 2020-05-09 11:03:08 -0400 |
commit | 654920f4419edef75757e14a9f9aa6c6a0f3ba41 (patch) | |
tree | 1f89c2bd726f0d0e50b7c2ca936e94884a9d2875 /lib/polyjuice/client/endpoint/get_sync.ex | |
parent | release 0.2.2 (diff) |
parse errors and reduce code duplication
Diffstat (limited to 'lib/polyjuice/client/endpoint/get_sync.ex')
-rw-r--r-- | lib/polyjuice/client/endpoint/get_sync.ex | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/lib/polyjuice/client/endpoint/get_sync.ex b/lib/polyjuice/client/endpoint/get_sync.ex index c30e680..511fb21 100644 --- a/lib/polyjuice/client/endpoint/get_sync.ex +++ b/lib/polyjuice/client/endpoint/get_sync.ex @@ -84,14 +84,8 @@ defmodule Polyjuice.Client.Endpoint.GetSync do } end - def transform_http_result(_req, status_code, _resp_headers, body) do - case status_code do - 200 -> - {:ok, Poison.decode!(body)} - - _ -> - {:error, status_code, body} - end + def transform_http_result(req, status_code, resp_headers, body) do + Polyjuice.Client.Endpoint.parse_response(req, status_code, resp_headers, body) end end end |