logging: improve visibility into ISE errors

This commit is contained in:
William Pitcock 2019-02-19 21:31:27 +00:00
parent 54f9e3d382
commit 8b08096436

View File

@ -4,13 +4,16 @@
defmodule Pleroma.Web.ErrorView do
use Pleroma.Web, :view
require Logger
def render("404.json", _assigns) do
%{errors: %{detail: "Page not found"}}
end
def render("500.json", _assigns) do
%{errors: %{detail: "Internal server error"}}
def render("500.json", assigns) do
Logger.error("Internal server error: #{inspect(assigns[:reason])}")
%{errors: %{detail: "Internal server error", reason: inspect(assigns[:reason])}}
end
# In case no render clause matches or no