diff --git a/lib/chiya_web/error.ex b/lib/chiya_web/error.ex new file mode 100644 index 0000000..c628a48 --- /dev/null +++ b/lib/chiya_web/error.ex @@ -0,0 +1,11 @@ +defmodule ChiyaWeb.Error do + import Plug.Conn, only: [put_status: 2] + import Phoenix.Controller, only: [put_view: 2, render: 3] + + def render_error(conn, :not_found, assigns \\ []) do + conn + |> put_status(:not_found) + |> put_view(ChiyaWeb.ErrorHTML) + |> render("404.html", assigns) + end +end \ No newline at end of file