ReceiverWorker: Make sure non-{:ok, _} is returned as {:error, …}

Otherwise an error like `{:signature, {:error, {:error, :not_found}}}` ends up considered a success.
This commit is contained in:
Haelwenn (lanodan) Monnier 2024-04-17 07:37:41 +02:00
parent d80e0d6873
commit a299ddb10e
No known key found for this signature in database
2 changed files with 3 additions and 1 deletions

View File

@ -0,0 +1 @@
ReceiverWorker: Make sure non-{:ok, _} is returned as {:error, …}

View File

@ -52,7 +52,8 @@ defmodule Pleroma.Workers.ReceiverWorker do
{:error, {:reject, reason}} -> {:cancel, reason}
{:signature, false} -> {:cancel, :invalid_signature}
{:error, {:error, reason = "Object has been deleted"}} -> {:cancel, reason}
e -> e
{:error, _} = e -> e
e -> {:error, e}
end
end
end