Chat Controller: Add basic error handling.

This commit is contained in:
lain 2020-05-12 13:23:09 +02:00
commit ec72cba43e
2 changed files with 15 additions and 2 deletions

View file

@ -18,8 +18,7 @@ defmodule Pleroma.Web.PleromaAPI.ChatController do
import Ecto.Query
import Pleroma.Web.ActivityPub.ObjectValidator, only: [stringify_keys: 1]
# TODO
# - Error handling
action_fallback(Pleroma.Web.MastodonAPI.FallbackController)
plug(
OAuthScopesPlug,
@ -53,6 +52,8 @@ defmodule Pleroma.Web.PleromaAPI.ChatController do
conn
|> put_view(ChatMessageView)
|> render("show.json", for: user, object: message, chat: chat)
else
_e -> {:error, :could_not_delete}
end
end