Packages

A set of bindings to RiskIQ's PassiveTotal API

Current section

Files

Jump to
passive_total lib passive_total utils.ex
Raw

lib/passive_total/utils.ex

defmodule PassiveTotal.Utils do
@doc """
Simple function to convert a tesla response to either a tuple
of {:ok, json} or {:error, reason}
"""
def parse_response(resp) do
case resp do
{:ok, %{status: 200, body: body}} ->
{:ok, body}
{:ok, other} ->
{:error, other}
other ->
other
end
end
end