forked from mirrors/akkoma
logging: only return ISE reasons in API responses when in dev or test mode
This commit is contained in:
parent
3ee77e95b2
commit
22e2ed235d
1 changed files with 5 additions and 1 deletions
|
@ -13,7 +13,11 @@ defmodule Pleroma.Web.ErrorView do
|
||||||
def render("500.json", assigns) do
|
def render("500.json", assigns) do
|
||||||
Logger.error("Internal server error: #{inspect(assigns[:reason])}")
|
Logger.error("Internal server error: #{inspect(assigns[:reason])}")
|
||||||
|
|
||||||
%{errors: %{detail: "Internal server error", reason: inspect(assigns[:reason])}}
|
if Mix.env() != :prod do
|
||||||
|
%{errors: %{detail: "Internal server error", reason: inspect(assigns[:reason])}}
|
||||||
|
else
|
||||||
|
%{errors: %{detail: "Internal server error"}}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# In case no render clause matches or no
|
# In case no render clause matches or no
|
||||||
|
|
Loading…
Reference in a new issue