diff options
author | Roger Braun <roger@rogerbraun.net> | 2017-09-15 08:18:29 +0200 |
---|---|---|
committer | Roger Braun <roger@rogerbraun.net> | 2017-09-15 08:18:29 +0200 |
commit | f445a1b3762b8ef67a86eab8390457b5bf70f62e (patch) | |
tree | 3f6708ae296f587f964d04b01511ea53a44a8cce /lib | |
parent | 3ca853fb6165b82c39f23e24783e813015db48d5 (diff) | |
download | pleroma-f445a1b3762b8ef67a86eab8390457b5bf70f62e.tar.gz |
Don't die on fetching problems.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/ostatus/ostatus.ex | 18 |
1 files changed, 12 insertions, 6 deletions
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 |