diff options
author | eal <eal@waifu.club> | 2017-10-25 21:25:37 +0300 |
---|---|---|
committer | eal <eal@waifu.club> | 2017-10-28 17:09:32 +0300 |
commit | 11d2287476fe9518cd0a3721a0fe7a0a1fd937fd (patch) | |
tree | 0db5020211d7faef68c5876787f7b451e99e9029 | |
parent | 813d2eaaf08efcb7aa87f6270e98c760b0b60b99 (diff) | |
download | pleroma-11d2287476fe9518cd0a3721a0fe7a0a1fd937fd.tar.gz |
Return error message on errors
-rw-r--r-- | lib/pleroma/web/mastodon_api/mastodon_api_controller.ex | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex index ea85e5bce..5032c735d 100644 --- a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex +++ b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex @@ -275,7 +275,10 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do {:ok, activity} <- ActivityPub.follow(follower, followed) do render conn, AccountView, "relationship.json", %{user: follower, target: followed} else - err -> err + {:error, message} = err -> + conn + |> put_resp_content_type("application/json") + |> send_resp(403, Poison.encode!(%{"error" => message})) end end |