upgrade to phoenix 1.7
This commit is contained in:
16
lib/cannery_web/controllers/error_html.ex
Normal file
16
lib/cannery_web/controllers/error_html.ex
Normal file
@ -0,0 +1,16 @@
|
||||
defmodule CanneryWeb.ErrorHTML do
|
||||
use CanneryWeb, :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
|
Reference in New Issue
Block a user