defmodule LivebookWeb.ErrorHTML do use LivebookWeb, :html def render("404.html", assigns) do ~H""" <.error_page status={404} title="No Numbats here!" /> """ end def render("403.html", assigns) do ~H""" <.error_page status={403} title="No Numbats allowed here!" /> """ end def render("error.html", assigns) do ~H""" <.error_page status={@status} title={assigns[:title] || "Something went wrong."} details={@details} /> """ end def render("401.html", assigns) do ~H""" <.error_page status={401} title="Not authorized" details={@details} /> """ end def render(_template, assigns) do ~H""" <.error_page status={@status} details="Check out the console for logs for more information." /> """ end attr :status, :integer, required: true attr :title, :string, default: "Something went wrong." attr :details, :string, default: nil def error_page(assigns) do ~H""" {@status} - Livebook
livebook
{@title}
{@details}
""" end end