More logging.
authorlain <lain@soykaf.club>
Fri, 23 Feb 2018 14:00:19 +0000 (15:00 +0100)
committerlain <lain@soykaf.club>
Fri, 23 Feb 2018 14:00:19 +0000 (15:00 +0100)
lib/pleroma/web/activity_pub/activity_pub.ex
lib/pleroma/web/ostatus/ostatus.ex

index d593460422121c3f42b0ced632157c476799e3c1..c27ec2c6b9fc035c597be1e17c40cc3fcf6c507d 100644 (file)
@@ -288,6 +288,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
       }
 
       {:ok, user_data}
+    else
+      e -> Logger.error("Could not user at fetch #{ap_id}, #{inspect(e)}")
     end
   end
 
@@ -353,12 +355,12 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
         {: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
index 91c4474c52d7618c0745efca6b8aff3028071727..3f5cfdc8abf3f596c7e2b6a90b3246de7c8b936a 100644 (file)
@@ -292,7 +292,10 @@ defmodule Pleroma.Web.OStatus do
     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
 
@@ -301,7 +304,10 @@ defmodule Pleroma.Web.OStatus do
     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