memEx/lib/memex_web/views/error_view.ex
shibao 947dd5ff55
All checks were successful
continuous-integration/drone/push Build is passing
use core components
2023-03-16 19:49:19 -04:00

16 lines
430 B
Elixir

defmodule MemexWeb.ErrorView do
use MemexWeb, :view
alias MemexWeb.HomeLive
def template_not_found(error_path, _assigns) do
error_string =
case error_path do
"404.html" -> dgettext("errors", "not found")
"401.html" -> dgettext("errors", "unauthorized")
_other_path -> dgettext("errors", "internal server error")
end
render("error.html", %{error_string: error_string})
end
end