1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.ErrorView do
9 def render("404.json", _assigns) do
10 %{errors: %{detail: "Page not found"}}
13 def render("500.json", assigns) do
14 Logger.error("Internal server error: #{inspect(assigns[:reason])}")
16 if Pleroma.Config.get(:env) != :prod do
17 %{errors: %{detail: "Internal server error", reason: inspect(assigns[:reason])}}
19 %{errors: %{detail: "Internal server error"}}
23 # In case no render clause matches or no
24 # template is found, let's render it as 500
25 def template_not_found(_template, assigns) do
26 render("500.json", assigns)