X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fviews%2Ferror_view.ex;h=5cb8669fe413b7f28d5215f34a2d4f8efed11cc1;hb=59e6b48553aa167a15e69eb2d174cbfc5202d77e;hp=d8158edb4fd0c1cf933a11231eaee17cf66bdef1;hpb=922abcda61298a7bca48894cb9a51a52fdeab1ed;p=akkoma
diff --git a/lib/pleroma/web/views/error_view.ex b/lib/pleroma/web/views/error_view.ex
index d8158edb4..5cb8669fe 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-2018 Pleroma Authors
+# Copyright © 2017-2019 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