From a1515f9a606f6e5bdc2acb969cff2baad986efc4 Mon Sep 17 00:00:00 2001 From: FloatingGhost Date: Fri, 9 Dec 2022 23:45:51 +0000 Subject: [PATCH] Add some extra info around possible nils --- lib/pleroma/user.ex | 2 +- lib/pleroma/web/activity_pub/activity_pub.ex | 2 +- lib/pleroma/web/activity_pub/transmogrifier.ex | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index c8262b37b..e32dd161e 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -1922,7 +1922,7 @@ def get_or_fetch_by_ap_id(ap_id) do {:ok, user} e -> - Logger.error("Could not fetch user, #{inspect(e)}") + Logger.error("Could not fetch user #{ap_id}, #{inspect(e)}") {:error, :not_found} end end diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index 521c8b852..3adb4ab54 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -1711,7 +1711,7 @@ def fetch_and_prepare_user_from_ap_id(ap_id, additional \\ []) do {:ok, maybe_update_follow_information(data)} else # If this has been deleted, only log a debug and not an error - {:error, {"Object has been deleted" = e, _, _}} -> + {:error, {"Object has been deleted", _, _} = e} -> Logger.debug("Could not decode user at fetch #{ap_id}, #{inspect(e)}") {:error, e} diff --git a/lib/pleroma/web/activity_pub/transmogrifier.ex b/lib/pleroma/web/activity_pub/transmogrifier.ex index b9d853610..77015241b 100644 --- a/lib/pleroma/web/activity_pub/transmogrifier.ex +++ b/lib/pleroma/web/activity_pub/transmogrifier.ex @@ -136,7 +136,7 @@ def fix_in_reply_to(%{"inReplyTo" => in_reply_to} = object, options) |> Map.drop(["conversation", "inReplyToAtomUri"]) else e -> - Logger.warn("Couldn't fetch #{inspect(in_reply_to_id)}, error: #{inspect(e)}") + Logger.warn("Couldn't fetch reply@#{inspect(in_reply_to_id)}, error: #{inspect(e)}") object end else @@ -159,7 +159,7 @@ def fix_quote_url(%{"quoteUri" => quote_url} = object, options) |> Map.put("quoteUri", quoted_object.data["id"]) else e -> - Logger.warn("Couldn't fetch #{inspect(quote_url)}, error: #{inspect(e)}") + Logger.warn("Couldn't fetch quote@#{inspect(quote_url)}, error: #{inspect(e)}") object end else @@ -833,7 +833,7 @@ def maybe_fix_object_url(%{"object" => object} = data) when is_binary(object) do Map.put(data, "object", external_url) else {:fetch, e} -> - Logger.error("Couldn't fetch #{object} #{inspect(e)}") + Logger.error("Couldn't fetch fixed_object@#{object} #{inspect(e)}") data _ ->