MastodonAPI.MastodonAPIController: Return a 404 when we fail to get a list
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Fri, 1 Feb 2019 17:15:15 +0000 (18:15 +0100)
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>
Fri, 1 Feb 2019 17:21:16 +0000 (18:21 +0100)
lib/pleroma/web/mastodon_api/mastodon_api_controller.ex

index 491ed9dc505d61dfba05ddd3dfbb10717360eeba..a94eb5c73f8f2b5e34b80ffbb1f54385f1dea907 100644 (file)
@@ -905,7 +905,10 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController 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