projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
813d2ea
)
Return error message on errors
author
eal
<eal@waifu.club>
Wed, 25 Oct 2017 18:25:37 +0000
(21:25 +0300)
committer
eal
<eal@waifu.club>
Sat, 28 Oct 2017 14:09:32 +0000
(17:09 +0300)
lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex
index ea85e5bcecbde597dd97775fbbf814055ef8f8d3..5032c735dc059edf5e09318b82c259eeed78662d 100644
(file)
--- 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