From: Roger Braun Date: Fri, 15 Sep 2017 06:18:29 +0000 (+0200) Subject: Don't die on fetching problems. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=f445a1b3762b8ef67a86eab8390457b5bf70f62e;p=akkoma Don't die on fetching problems. --- diff --git a/lib/pleroma/web/ostatus/ostatus.ex b/lib/pleroma/web/ostatus/ostatus.ex index 882226172..1fd868a90 100644 --- a/lib/pleroma/web/ostatus/ostatus.ex +++ b/lib/pleroma/web/ostatus/ostatus.ex @@ -300,12 +300,18 @@ defmodule Pleroma.Web.OStatus do end def fetch_activity_from_url(url) do - with {:ok, activities} when length(activities) > 0 <- fetch_activity_from_atom_url(url) do - {:ok, activities} - else - _e -> with {:ok, activities} <- fetch_activity_from_html_url(url) do - {:ok, activities} - end + try do + with {:ok, activities} when length(activities) > 0 <- fetch_activity_from_atom_url(url) do + {:ok, activities} + else + _e -> with {:ok, activities} <- fetch_activity_from_html_url(url) do + {:ok, activities} + end + end + rescue + e -> + Logger.debug("Couldn't get #{url}: #{inspect(e)}") + {:error, "Couldn't get #{url}: #{inspect(e)}"} end end end