Expand description
CMS-editable error pages (404/500/…).
Editors create a page of the built-in Error page type, pick the
HTTP status it serves (404/403/500/503) and compose its body from
content blocks. The public router substitutes that page — rendered
through the full pipeline (navbar via auto_menu, footer, theme,
_stream_html) — for the previously plain-text error responses,
keeping the real error status code on the wire.
When no published Error page exists for a status (or the error page
itself fails to render), fallback_response serves a bundled,
fully self-contained HTML page — no Tera, no DB — so the error path
can never recurse into another error.
The extension table is created at boot via CREATE TABLE IF NOT EXISTS (same pattern as crate::forms::submit::ensure_table)
because repo-wide gen_migration is blocked by pre-existing
framework FK-snapshot drift.
Structs§
- Error
Page - The built-in Error page type. Hand-rolled (not
#[derive(PageType)]— the derive emits::rustango_cms::paths that don’t resolve from inside this crate). - Error
Page Ext - Typed extension row for an Error page: the HTTP status it serves plus its block-stream body.
Constants§
- BODY_
BLOCKS - The blocks an Error page’s body accepts.
- STATUSES
- The HTTP statuses an Error page can serve.
- TYPE_
NAME - Registry
type_namefor the built-in Error page type.
Functions§
- ensure_
table - Create
cms_error_pageif absent. Idempotent; called per tenant at boot fromcrate::seed::ensure_seeded. - find_
for_ status - Find the published Error page configured for
code, if any. Lowestpage_idwins when several published pages claim the same status (deterministic, oldest-first).