chiya/lib/chiya_web/error.ex

12 lines
306 B
Elixir
Raw Permalink Normal View History

defmodule ChiyaWeb.Error do
2023-03-31 16:58:10 +02:00
import Plug.Conn, only: [put_status: 2]
2023-07-08 15:05:16 +02:00
import Phoenix.Controller, only: [put_view: 2, render: 3]
2023-03-31 16:58:10 +02:00
def render_error(conn, :not_found, assigns \\ []) do
conn
2023-07-07 10:10:22 +02:00
|> put_status(:not_found)
|> put_view(ChiyaWeb.ErrorHTML)
|> render("404.html", assigns)
end
2023-03-31 16:58:10 +02:00
end