diff --git a/lib/federation/activity_pub/fetcher.ex b/lib/federation/activity_pub/fetcher.ex index 97166baa2..288c4a394 100644 --- a/lib/federation/activity_pub/fetcher.ex +++ b/lib/federation/activity_pub/fetcher.ex @@ -42,7 +42,7 @@ defmodule Mobilizon.Federation.ActivityPub.Fetcher do end @spec fetch_and_create(String.t(), Keyword.t()) :: - {:ok, map(), struct()} | {:error, atom()} | :error + {:ok, map(), struct()} | {:error, atom()} | {:error, Ecto.Changeset.t()} | :error def fetch_and_create(url, options \\ []) do case fetch(url, options) do {:ok, data} when is_map(data) -> @@ -61,6 +61,9 @@ defmodule Mobilizon.Federation.ActivityPub.Fetcher do {:error, error} when is_atom(error) -> {:error, error} + {:error, %Ecto.Changeset{} = err} -> + {:error, err} + :error -> {:error, :transmogrifier_error} end