22093b8ca4
Signed-off-by: Thomas Citharel <tcit@tcit.fr> fix error Signed-off-by: Thomas Citharel <tcit@tcit.fr> Fix tests and warnings Move process_geom/2 to addresses where it belongs Create a special error view for invalid requests Signed-off-by: Thomas Citharel <tcit@tcit.fr> credo fix Signed-off-by: Thomas Citharel <tcit@tcit.fr>
25 lines
507 B
Elixir
25 lines
507 B
Elixir
defmodule EventosWeb.ErrorView do
|
|
@moduledoc """
|
|
View for errors
|
|
"""
|
|
use EventosWeb, :view
|
|
|
|
def render("404.html", _assigns) do
|
|
"Page not found"
|
|
end
|
|
|
|
def render("invalid_request.json", _assigns) do
|
|
%{errors: "Invalid request"}
|
|
end
|
|
|
|
def render("500.html", _assigns) do
|
|
"Internal server error"
|
|
end
|
|
|
|
# In case no render clause matches or no
|
|
# template is found, let's render it as 500
|
|
def template_not_found(_template, assigns) do
|
|
render "500.html", assigns
|
|
end
|
|
end
|