memEx/lib/memex_web/views/error_view.ex

17 lines
466 B
Elixir
Raw Normal View History

2022-07-25 19:31:54 -04:00
defmodule MemexWeb.ErrorView do
use MemexWeb, :view
import MemexWeb.Components.Topbar
2022-11-18 22:30:33 -05:00
alias MemexWeb.HomeLive
2021-03-11 21:12:55 -05:00
2022-02-25 21:53:04 -05:00
def template_not_found(error_path, _assigns) do
error_string =
case error_path do
2022-11-26 14:51:18 -05:00
"404.html" -> dgettext("errors", "not found")
"401.html" -> dgettext("errors", "unauthorized")
2023-02-04 17:36:27 -05:00
_other_path -> dgettext("errors", "internal server error")
2022-02-25 21:53:04 -05:00
end
2021-03-11 21:12:55 -05:00
2022-02-25 21:53:04 -05:00
render("error.html", %{error_string: error_string})
2021-03-11 21:12:55 -05:00
end
end