}
{:ok, user_data}
+ else
+ e -> Logger.error("Could not user at fetch #{ap_id}, #{inspect(e)}")
end
end
{:ok, Object.get_by_ap_id(activity.data["object"]["id"])}
else
object = %Object{} -> {:ok, object}
- e ->
- Logger.info("Couldn't get object via AP, trying out OStatus fetching...")
- case OStatus.fetch_activity_from_url(id) do
- {:ok, [activity | _]} -> {:ok, Object.get_by_ap_id(activity.data["object"]["id"])}
- _ -> e
- end
+ e ->
+ Logger.info("Couldn't get object via AP, trying out OStatus fetching...")
+ case OStatus.fetch_activity_from_url(id) do
+ {:ok, [activity | _]} -> {:ok, Object.get_by_ap_id(activity.data["object"]["id"])}
+ e -> e
+ end
end
end
end
with {:ok, %{body: body, status_code: code}} when code in 200..299 <- @httpoison.get(url, [Accept: "application/atom+xml"], follow_redirect: true, timeout: 10000, recv_timeout: 20000) do
Logger.debug("Got document from #{url}, handling...")
handle_incoming(body)
- else e -> Logger.debug("Couldn't get #{url}: #{inspect(e)}")
+ else
+ e ->
+ Logger.debug("Couldn't get #{url}: #{inspect(e)}")
+ e
end
end
with {:ok, %{body: body}} <- @httpoison.get(url, [], follow_redirect: true, timeout: 10000, recv_timeout: 20000),
{:ok, atom_url} <- get_atom_url(body) do
fetch_activity_from_atom_url(atom_url)
- else e -> Logger.debug("Couldn't get #{url}: #{inspect(e)}")
+ else
+ e ->
+ Logger.debug("Couldn't get #{url}: #{inspect(e)}")
+ e
end
end