commit: a299ddb10e5b682194710d97eed541277c9d22b6
parent d80e0d6873a61159a68b337d7f42f46cbdad8e9d
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Wed, 17 Apr 2024 07:37:41 +0200
ReceiverWorker: Make sure non-{:ok, _} is returned as {:error, …}
Otherwise an error like `{:signature, {:error, {:error, :not_found}}}` ends up considered a success.
Diffstat:
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/changelog.d/receiverworker-error-handling.fix b/changelog.d/receiverworker-error-handling.fix
@@ -0,0 +1 @@
+ReceiverWorker: Make sure non-{:ok, _} is returned as {:error, …}
+\ No newline at end of file
diff --git a/lib/pleroma/workers/receiver_worker.ex b/lib/pleroma/workers/receiver_worker.ex
@@ -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