memEx/lib/memex_web/controllers/error_html.ex
shibao 63d854ffbe
All checks were successful
continuous-integration/drone/push Build is passing
upgrade to phoenix 1.7
2023-04-13 23:29:29 -04:00

17 lines
407 B
Elixir

defmodule MemexWeb.ErrorHTML do
use MemexWeb, :html
embed_templates "error_html/*"
def render(template, _assigns) do
error_string =
case template do
"404.html" -> dgettext("errors", "not found")
"401.html" -> dgettext("errors", "unauthorized")
_other_path -> dgettext("errors", "internal server error")
end
error(%{error_string: error_string})
end
end