From: stwf Date: Thu, 24 Oct 2019 16:08:34 +0000 (-0400) Subject: object fetcher error handling X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=2ab072f94947ee7ee719eff86f012e6302eeeacd;p=akkoma object fetcher error handling --- diff --git a/lib/pleroma/object/fetcher.ex b/lib/pleroma/object/fetcher.ex index 7758cb90b..441ae8b65 100644 --- a/lib/pleroma/object/fetcher.ex +++ b/lib/pleroma/object/fetcher.ex @@ -90,6 +90,9 @@ defmodule Pleroma.Object.Fetcher do {:fetch_object, %Object{} = object} -> {:ok, object} + {:fetch, {:error, error}} -> + {:error, error} + e -> e end @@ -110,6 +113,9 @@ defmodule Pleroma.Object.Fetcher do with {:ok, object} <- fetch_object_from_id(id, options) do object else + {:error, %Tesla.Mock.Error{}} -> + nil + e -> Logger.error("Error while fetching #{id}: #{inspect(e)}") nil @@ -170,6 +176,9 @@ defmodule Pleroma.Object.Fetcher do {:scheme, _} -> {:error, "Unsupported URI scheme"} + {:error, e} -> + {:error, e} + e -> {:error, e} end