projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
07a6f8b
)
object fetcher error handling
author
stwf
<steven.fuchs@dockyard.com>
Thu, 24 Oct 2019 16:08:34 +0000
(12:08 -0400)
committer
stwf
<steven.fuchs@dockyard.com>
Thu, 24 Oct 2019 16:08:34 +0000
(12:08 -0400)
lib/pleroma/object/fetcher.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/object/fetcher.ex
b/lib/pleroma/object/fetcher.ex
index 7758cb90b1f6637d5fdb406a5fb0fe474713c903..441ae8b6557e9601e19ab0fd3c781b3812f35b8c 100644
(file)
--- a/
lib/pleroma/object/fetcher.ex
+++ b/
lib/pleroma/object/fetcher.ex
@@
-90,6
+90,9
@@
defmodule Pleroma.Object.Fetcher do
{:fetch_object, %Object{} = object} ->
{:ok, object}
+ {:fetch, {:error, error}} ->
+ {:error, error}
+
e ->
e
end
@@
-110,6
+113,9
@@
defmodule Pleroma.Object.Fetcher do
with {:ok, object} <- fetch_object_from_id(id, options) do
object
else
+ {:error, %Tesla.Mock.Error{}} ->
+ nil
+
e ->
Logger.error("Error while fetching #{id}: #{inspect(e)}")
nil
@@
-170,6
+176,9
@@
defmodule Pleroma.Object.Fetcher do
{:scheme, _} ->
{:error, "Unsupported URI scheme"}
+ {:error, e} ->
+ {:error, e}
+
e ->
{:error, e}
end