Allow custom error titles

This commit is contained in:
Alexandre de Souza 2025-08-20 13:03:10 -03:00
parent 3f1b0b1934
commit 7ca85bd985
No known key found for this signature in database
GPG key ID: E39228FFBA346545

View file

@ -15,7 +15,11 @@ defmodule LivebookWeb.ErrorHTML do
def render("error.html", assigns) do def render("error.html", assigns) do
~H""" ~H"""
<.error_page status={@status} title="Something went wrong." details={@details} /> <.error_page
status={@status}
title={assigns[:title] || "Something went wrong."}
details={@details}
/>
""" """
end end
@ -29,14 +33,13 @@ defmodule LivebookWeb.ErrorHTML do
~H""" ~H"""
<.error_page <.error_page
status={@status} status={@status}
title="Something went wrong."
details="Check out the console for logs for more information." details="Check out the console for logs for more information."
/> />
""" """
end end
attr :status, :integer, required: true attr :status, :integer, required: true
attr :title, :string, required: true attr :title, :string, default: "Something went wrong."
attr :details, :string, default: nil attr :details, :string, default: nil
def error_page(assigns) do def error_page(assigns) do