Improved detecting unrecoverable errors for incoming federation jobs

This commit is contained in:
Mark Felder 2024-07-20 21:52:57 -04:00
parent b8503f1ad4
commit d62a9afed3
2 changed files with 7 additions and 4 deletions

View file

@ -0,0 +1 @@
Improved detecting unrecoverable errors for incoming federation jobs

View file

@ -47,11 +47,13 @@ defmodule Pleroma.Workers.ReceiverWorker do
case errors do
{:error, :origin_containment_failed} -> {:cancel, :origin_containment_failed}
{:error, :already_present} -> {:cancel, :already_present}
{:error, {:validate_object, reason}} -> {:cancel, reason}
{:error, {:error, {:validate, reason}}} -> {:cancel, reason}
{:error, {:reject, reason}} -> {:cancel, reason}
{:error, {:validate_object, _} = reason} -> {:cancel, reason}
{:error, {:validate, _} = reason} -> {:cancel, reason}
{:error, {:reject, _} = reason} -> {:cancel, reason}
{:signature, false} -> {:cancel, :invalid_signature}
{:error, {:error, reason = "Object has been deleted"}} -> {:cancel, reason}
{:error, "Object has been deleted"} = reason -> {:cancel, reason}
{:error, {:side_effects, {:error, :no_object_actor}} = reason} -> {:cancel, reason}
{:error, :not_found} = reason -> {:cancel, reason}
{:error, _} = e -> e
e -> {:error, e}
end