Better error handling for ActivityPubController
This commit is contained in:
parent
4856ba596f
commit
06439f64d0
3 changed files with 11 additions and 8 deletions
|
|
@ -27,9 +27,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubController do
|
|||
|> json(ObjectView.render("object.json", %{object: object}))
|
||||
else
|
||||
{:public?, false} ->
|
||||
conn
|
||||
|> put_status(404)
|
||||
|> json("Not found")
|
||||
{:error, :not_found}
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -107,6 +105,12 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubController do
|
|||
json(conn, "ok")
|
||||
end
|
||||
|
||||
def errors(conn, {:error, :not_found}) do
|
||||
conn
|
||||
|> put_status(404)
|
||||
|> json("Not found")
|
||||
end
|
||||
|
||||
def errors(conn, _e) do
|
||||
conn
|
||||
|> put_status(500)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue