Add federator error logging
This commit is contained in:
parent
ef3b435a8d
commit
c942d1b955
|
@ -81,6 +81,9 @@ defmodule Clacks.ActivityPub.Federator do
|
|||
{:ok, %HTTPoison.Response{status_code: status_code}} when status_code in 200..299 ->
|
||||
:ok
|
||||
|
||||
{:ok, %HTTPoison.Response{status_code: status_code, body: body}} ->
|
||||
{:error, "unexpected response code #{status_code}: #{inspect(body)}"}
|
||||
|
||||
{:error, _} = err ->
|
||||
err
|
||||
end
|
||||
|
|
|
@ -10,6 +10,13 @@ defmodule Clacks.Worker.Federate do
|
|||
activity = Repo.get(Activity, activity_id)
|
||||
actor = Repo.get(Actor, actor_id)
|
||||
|
||||
:ok = ActivityPub.Federator.federate_to_involved(activity, actor)
|
||||
case ActivityPub.Federator.federate_to_involved(activity, actor) do
|
||||
:ok ->
|
||||
:ok
|
||||
|
||||
{:error, reason} ->
|
||||
Logger.error("Error federating '#{activity_id}' to '#{actor_id}': #{inspect(reason)}")
|
||||
{:error, reason}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue