cannery/lib/cannery_web/views/error_view.ex
2022-02-09 00:13:12 -05:00

16 lines
438 B
Elixir

defmodule CanneryWeb.ErrorView do
use CanneryWeb, :view
alias CanneryWeb.{Endpoint, 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")
_ -> dgettext("errors", "Internal Server Error")
end
render("error.html", %{error_string: error_string})
end
end