Object.Fetcher: Handle error on Containment.contain_origin/2
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Sun, 14 Jul 2019 10:02:16 +0000 (12:02 +0200)
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Sun, 14 Jul 2019 12:58:47 +0000 (14:58 +0200)
lib/pleroma/object/fetcher.ex

index 101c21f9629e8da4b33b4d988baedeafe8d3b608..82250ab8de98038703488d3e98fbe4439f392306 100644 (file)
@@ -38,6 +38,7 @@ defmodule Pleroma.Object.Fetcher do
              "type" => "Create",
              "to" => data["to"],
              "cc" => data["cc"],
+             # TODO: Should we seriously keep this attributedTo thing?
              "actor" => data["actor"] || data["attributedTo"],
              "object" => data
            },
@@ -56,6 +57,9 @@ defmodule Pleroma.Object.Fetcher do
         object = %Object{} ->
           {:ok, object}
 
+        :error ->
+          {:error, "Object containment failed."}
+
         _e ->
           Logger.info("Couldn't get object via AP, trying out OStatus fetching...")