diff options
| -rw-r--r-- | lib/pleroma/object/fetcher.ex | 4 | ||||
| -rw-r--r-- | lib/pleroma/workers/remote_fetcher_worker.ex | 8 | ||||
| -rw-r--r-- | test/pleroma/object/fetcher_test.exs | 4 | ||||
| -rw-r--r-- | test/pleroma/web/twitter_api/remote_follow_controller_test.exs | 2 | 
4 files changed, 9 insertions, 9 deletions
| diff --git a/lib/pleroma/object/fetcher.ex b/lib/pleroma/object/fetcher.ex index 5bc1cfd5e..0c90e0eaa 100644 --- a/lib/pleroma/object/fetcher.ex +++ b/lib/pleroma/object/fetcher.ex @@ -220,10 +220,10 @@ defmodule Pleroma.Object.Fetcher do          end        {:ok, %{status: 403}} -> -        {:error, "Object fetch has been denied"} +        {:error, :forbidden}        {:ok, %{status: code}} when code in [404, 410] -> -        {:error, "Object has been deleted"} +        {:error, :not_found}        {:error, e} ->          {:error, e} diff --git a/lib/pleroma/workers/remote_fetcher_worker.ex b/lib/pleroma/workers/remote_fetcher_worker.ex index d4fae33df..dca4530d7 100644 --- a/lib/pleroma/workers/remote_fetcher_worker.ex +++ b/lib/pleroma/workers/remote_fetcher_worker.ex @@ -15,11 +15,11 @@ defmodule Pleroma.Workers.RemoteFetcherWorker do          {:ok, _object} ->            :ok -        {:error, reason = "Object fetch has been denied"} -> -          {:cancel, reason} +        {:error, :forbidden} -> +          {:cancel, :forbidden} -        {:error, reason = "Object has been deleted"} -> -          {:cancel, reason} +        {:error, :not_found} -> +          {:cancel, :not_found}          _ ->            :error diff --git a/test/pleroma/object/fetcher_test.exs b/test/pleroma/object/fetcher_test.exs index 53c9277d6..24f114c00 100644 --- a/test/pleroma/object/fetcher_test.exs +++ b/test/pleroma/object/fetcher_test.exs @@ -220,14 +220,14 @@ defmodule Pleroma.Object.FetcherTest do      end      test "handle HTTP 410 Gone response" do -      assert {:error, "Object has been deleted"} == +      assert {:error, :not_found} ==                 Fetcher.fetch_and_contain_remote_object_from_id(                   "https://mastodon.example.org/users/userisgone"                 )      end      test "handle HTTP 404 response" do -      assert {:error, "Object has been deleted"} == +      assert {:error, :not_found} ==                 Fetcher.fetch_and_contain_remote_object_from_id(                   "https://mastodon.example.org/users/userisgone404"                 ) diff --git a/test/pleroma/web/twitter_api/remote_follow_controller_test.exs b/test/pleroma/web/twitter_api/remote_follow_controller_test.exs index 41f8ebcd7..c6ecb53f4 100644 --- a/test/pleroma/web/twitter_api/remote_follow_controller_test.exs +++ b/test/pleroma/web/twitter_api/remote_follow_controller_test.exs @@ -137,7 +137,7 @@ defmodule Pleroma.Web.TwitterAPI.RemoteFollowControllerTest do                   |> html_response(200)                 assert response =~ "Error fetching user" -             end) =~ "Object has been deleted" +             end) =~ ":not_found"      end    end | 
