conn
|> put_resp_header("content-type", "application/activity+json")
|> json(UserView.render("user.json", %{user: user}))
+ else
+ nil -> {:error, :not_found}
end
end
|> json(ObjectView.render("object.json", %{object: object}))
else
{:public?, false} ->
- conn
- |> put_status(404)
- |> json("Not found")
+ {:error, :not_found}
end
end
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)