MastodonAPI.MastodonAPIController: Return a 404 when we fail to get a list

This commit is contained in:
Haelwenn (lanodan) Monnier 2019-02-01 18:15:15 +01:00
parent 0a82a7e6d6
commit 74c6119f28
No known key found for this signature in database
GPG Key ID: D5B7A8E43C997DEE

View File

@ -905,7 +905,10 @@ def get_list(%{assigns: %{user: user}} = conn, %{"id" => id}) do
res = ListView.render("list.json", list: list)
json(conn, res)
else
_e -> json(conn, "error")
_e ->
conn
|> put_status(404)
|> json(%{error: "Record not found"})
end
end