mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-27 08:16:16 +00:00
Return error message on errors
This commit is contained in:
parent
813d2eaaf0
commit
11d2287476
|
@ -275,7 +275,10 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do
|
||||||
{:ok, activity} <- ActivityPub.follow(follower, followed) do
|
{:ok, activity} <- ActivityPub.follow(follower, followed) do
|
||||||
render conn, AccountView, "relationship.json", %{user: follower, target: followed}
|
render conn, AccountView, "relationship.json", %{user: follower, target: followed}
|
||||||
else
|
else
|
||||||
err -> err
|
{:error, message} = err ->
|
||||||
|
conn
|
||||||
|
|> put_resp_content_type("application/json")
|
||||||
|
|> send_resp(403, Poison.encode!(%{"error" => message}))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue