Add some extra info around possible nils
Some checks are pending
ci/woodpecker/push/woodpecker Pipeline is pending
Some checks are pending
ci/woodpecker/push/woodpecker Pipeline is pending
This commit is contained in:
parent
2144ce5188
commit
a1515f9a60
3 changed files with 5 additions and 5 deletions
|
@ -1922,7 +1922,7 @@ def get_or_fetch_by_ap_id(ap_id) do
|
||||||
{:ok, user}
|
{:ok, user}
|
||||||
|
|
||||||
e ->
|
e ->
|
||||||
Logger.error("Could not fetch user, #{inspect(e)}")
|
Logger.error("Could not fetch user #{ap_id}, #{inspect(e)}")
|
||||||
{:error, :not_found}
|
{:error, :not_found}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1711,7 +1711,7 @@ def fetch_and_prepare_user_from_ap_id(ap_id, additional \\ []) do
|
||||||
{:ok, maybe_update_follow_information(data)}
|
{:ok, maybe_update_follow_information(data)}
|
||||||
else
|
else
|
||||||
# If this has been deleted, only log a debug and not an error
|
# 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)}")
|
Logger.debug("Could not decode user at fetch #{ap_id}, #{inspect(e)}")
|
||||||
{:error, e}
|
{:error, e}
|
||||||
|
|
||||||
|
|
|
@ -136,7 +136,7 @@ def fix_in_reply_to(%{"inReplyTo" => in_reply_to} = object, options)
|
||||||
|> Map.drop(["conversation", "inReplyToAtomUri"])
|
|> Map.drop(["conversation", "inReplyToAtomUri"])
|
||||||
else
|
else
|
||||||
e ->
|
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
|
object
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
@ -159,7 +159,7 @@ def fix_quote_url(%{"quoteUri" => quote_url} = object, options)
|
||||||
|> Map.put("quoteUri", quoted_object.data["id"])
|
|> Map.put("quoteUri", quoted_object.data["id"])
|
||||||
else
|
else
|
||||||
e ->
|
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
|
object
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
@ -833,7 +833,7 @@ def maybe_fix_object_url(%{"object" => object} = data) when is_binary(object) do
|
||||||
Map.put(data, "object", external_url)
|
Map.put(data, "object", external_url)
|
||||||
else
|
else
|
||||||
{:fetch, e} ->
|
{:fetch, e} ->
|
||||||
Logger.error("Couldn't fetch #{object} #{inspect(e)}")
|
Logger.error("Couldn't fetch fixed_object@#{object} #{inspect(e)}")
|
||||||
data
|
data
|
||||||
|
|
||||||
_ ->
|
_ ->
|
||||||
|
|
Loading…
Reference in a new issue