mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-19 03:35:02 +00:00
Don't crash on activity handling problems.
This commit is contained in:
parent
368fa25f1f
commit
c3dfa1970f
1 changed files with 26 additions and 17 deletions
|
@ -32,6 +32,7 @@ defmodule Pleroma.Web.OStatus do
|
||||||
{:xmlObj, :string, verb} = :xmerl_xpath.string('string(/entry/activity:verb[1])', entry)
|
{:xmlObj, :string, verb} = :xmerl_xpath.string('string(/entry/activity:verb[1])', entry)
|
||||||
Logger.debug("Handling #{verb}")
|
Logger.debug("Handling #{verb}")
|
||||||
|
|
||||||
|
try do
|
||||||
case verb do
|
case verb do
|
||||||
'http://activitystrea.ms/schema/1.0/follow' ->
|
'http://activitystrea.ms/schema/1.0/follow' ->
|
||||||
with {:ok, activity} <- FollowHandler.handle(entry, doc), do: activity
|
with {:ok, activity} <- FollowHandler.handle(entry, doc), do: activity
|
||||||
|
@ -50,7 +51,15 @@ defmodule Pleroma.Web.OStatus do
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
rescue
|
||||||
|
e ->
|
||||||
|
Logger.error("Error occured while handling activity")
|
||||||
|
Logger.error(inspect(e))
|
||||||
|
nil
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|> Enum.filter(&(&1))
|
||||||
|
|
||||||
{:ok, activities}
|
{:ok, activities}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue