2021-03-11 21:12:55 -05:00
|
|
|
defmodule CanneryWeb.ErrorView do
|
|
|
|
use CanneryWeb, :view
|
2022-02-11 22:47:33 -05:00
|
|
|
import CanneryWeb.Components.Topbar
|
2022-02-08 22:56:57 -05:00
|
|
|
alias CanneryWeb.{Endpoint, HomeLive}
|
2021-03-11 21:12:55 -05:00
|
|
|
|
2022-02-08 22:56:57 -05:00
|
|
|
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
|
2021-03-11 21:12:55 -05:00
|
|
|
|
2022-02-08 22:56:57 -05:00
|
|
|
render("error.html", %{error_string: error_string})
|
2021-03-11 21:12:55 -05:00
|
|
|
end
|
|
|
|
end
|