X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fpleroma%2Fweb%2Fviews%2Ferror_view.ex;h=e68d55e0850e79c14f8f2200d5f19518b4c6862b;hb=a92c713d9c761563c72d0f660574878aa569249a;hp=86a1744b77254f7ea15ad62e8009dbb0580decb3;hpb=32541172cd490d68ada7e65e9f59b71bb04e0bde;p=akkoma
diff --git a/lib/pleroma/web/views/error_view.ex b/lib/pleroma/web/views/error_view.ex
index 86a1744b7..e68d55e08 100644
--- a/lib/pleroma/web/views/error_view.ex
+++ b/lib/pleroma/web/views/error_view.ex
@@ -1,16 +1,23 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2020 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
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])}")
+
+ if Pleroma.Config.get(: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