Add some debugging to federations.
authorRoger Braun <roger@rogerbraun.net>
Tue, 20 Jun 2017 12:10:44 +0000 (14:10 +0200)
committerRoger Braun <roger@rogerbraun.net>
Tue, 20 Jun 2017 12:10:44 +0000 (14:10 +0200)
lib/pleroma/web/websub/websub.ex

index a683f6da40de022e443630f8adb279471f019431..12edf094cce4c38b6e46cc6195702e107b7c1157 100644 (file)
@@ -53,10 +53,14 @@ defmodule Pleroma.Web.Websub do
       Logger.debug(fn -> "Pushing to #{sub.callback}" end)
 
       Task.start(fn ->
-        @httpoison.post(sub.callback, response, [
+        with {:ok, %{status_code: code}} <- @httpoison.post(sub.callback, response, [
               {"Content-Type", "application/atom+xml"},
               {"X-Hub-Signature", "sha1=#{signature}"}
-            ])
+                    ]) do
+          Logger.debug(fn -> "Pushed to #{sub.callback}, code #{code}" end)
+        else e ->
+            Logger.debug(fn -> "Couldn't push to #{sub.callback}, #{inspect(e)}" end)
+        end
       end)
     end)
   end