Log error when handling unrepeats
authorFrancis Dinh <normandy@firemail.cc>
Fri, 11 May 2018 19:29:19 +0000 (15:29 -0400)
committerFrancis Dinh <normandy@firemail.cc>
Fri, 11 May 2018 19:29:19 +0000 (15:29 -0400)
lib/pleroma/web/activity_pub/transmogrifier.ex

index 586fe2eb2567bb8e576a03aa9c352c6682ec203c..0c4a6276255b648965b9b3ff480527e0579bd4bf 100644 (file)
@@ -216,25 +216,24 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
          {:ok, activity} <- ActivityPub.delete(object, false) do
       {:ok, activity}
     else
-      e -> :error
+      e ->
+        Logger.error(e)
+        :error
     end
   end
 
   def handle_incoming(
-        %{
-          "type" => "Undo",
-          "object" => %{"type" => "Announce", "id" => object_id},
-          "actor" => actor,
-          "id" => id
-        } = data
-      ) do
+    %{"type" => "Undo", "object" => %{"type" => "Announce", "id" => object_id}, "actor" => actor, "id" => id} = data
+     ) do
     with %User{} = actor <- User.get_or_fetch_by_ap_id(actor),
          {:ok, object} <-
            get_obj_helper(object_id) || ActivityPub.fetch_object_from_id(object_id),
          {:ok, activity, _, _} <- ActivityPub.unannounce(actor, object, id, false) do
       {:ok, activity}
     else
-      e -> :error
+      e ->
+        Logger.error(e)
+        :error
     end
   end