Skip to content
Snippets Groups Projects
Commit 22e2ed23 authored by kaniini's avatar kaniini
Browse files

logging: only return ISE reasons in API responses when in dev or test mode

parent 3ee77e95
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,11 @@ defmodule Pleroma.Web.ErrorView do
def render("500.json", assigns) do
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
# In case no render clause matches or no
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment