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="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("503.html", assigns) do ~H""" <.error_page status={503} title="Service unavailable" details="The server is currently down or under maintenance" /> """ end def render(_template, assigns) do ~H""" <.error_page status={@status} title="Something went wrong." details="Check out the console for logs for more information." /> """ end attr :status, :integer, required: true attr :title, :string, required: true attr :details, :string, default: nil def error_page(assigns) do ~H""" {@status} - Livebook <%= if LivebookWeb.Layouts.dev?() do %> <% else %> <% end %>
livebook
{@title}
{@details}
""" end end