From 8b08096436c38562fab287e0cd04a3e57dd92ab0 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Tue, 19 Feb 2019 21:31:27 +0000 Subject: [PATCH] logging: improve visibility into ISE errors --- lib/pleroma/web/views/error_view.ex | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/pleroma/web/views/error_view.ex b/lib/pleroma/web/views/error_view.ex index 86a1744b7..aefc844fd 100644 --- a/lib/pleroma/web/views/error_view.ex +++ b/lib/pleroma/web/views/error_view.ex @@ -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 -- 2.45.2