add license boilerplate to pleroma core
[akkoma] / lib / pleroma / web / views / error_view.ex
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Web.ErrorView do
6 use Pleroma.Web, :view
7
8 def render("404.json", _assigns) do
9 %{errors: %{detail: "Page not found"}}
10 end
11
12 def render("500.json", _assigns) do
13 %{errors: %{detail: "Internal server error"}}
14 end
15
16 # In case no render clause matches or no
17 # template is found, let's render it as 500
18 def template_not_found(_template, assigns) do
19 render("500.json", assigns)
20 end
21 end