blob: ab705e1ac9ef603c0f459e3b563a11551c870f9d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
defmodule MatrixAppServiceWeb.ErrorView do
use MatrixAppServiceWeb, :view
def render("401.json", _assigns) do
%{errcode: "EX.MAP.UNAUTHORIZED"}
end
def render("403.json", _assigns) do
%{errcode: "EX.MAP.FORBIDDEN"}
end
# By default, Phoenix returns the status message from
# the template name. For example, "404.json" becomes
# "Not Found".
def template_not_found(template, _assigns) do
%{errors: %{detail: Phoenix.Controller.status_message_from_template(template)}}
end
end
|