Skip to main content

Module error_pages

Module error_pages 

Source
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§

ErrorPage
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).
ErrorPageExt
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_name for the built-in Error page type.

Functions§

ensure_table
Create cms_error_page if absent. Idempotent; called per tenant at boot from crate::seed::ensure_seeded.
find_for_status
Find the published Error page configured for code, if any. Lowest page_id wins when several published pages claim the same status (deterministic, oldest-first).