{# Jinja2 base template for Duck Framework built-in error and default pages. #} {# Context variables: title (str) — browser tab title icon_link (str) — favicon URL icon_type (str) — favicon MIME type heading (str) — primary heading text body (str, optional) — explanatory body text status_code (int, optional) — HTTP status code, e.g. 404 status_label (str, optional) — short label, e.g. "Not Found" error_label (str, optional) — red highlighted error string, e.g. exception class name debug (bool) — show debug mode notice when True request (obj, optional) — exposes .method, .path, .http_version exception (obj, optional) — exposes .message and .traceback #} {{ title }} {# One-shot scan line sweep on page load #} {# Floating ambient particles — JS positions and assigns timing variables #} {# Ambient watermark — status code or duck emoji behind the card #}
{% block main %} {# Eyebrow pill — e.g. "404 · Not Found" #} {% if status_code is defined %} {{ status_code }} · {{ status_label | default("Error") }} {% endif %} {# Primary heading #}

{{ heading }}

{# Request metadata — method, path, and HTTP version #} {% if request is defined and request %}
{{ request.method }} {{ request.path }} {% if request.http_version is defined and request.http_version %} · {% if request.request_store.get("h2_handling") %} HTTP/2 {% else %} {{ request.http_version }} {% endif %} {% endif %}
{% endif %} {# Red error label — exception class name or short error string #} {% if error_label is defined and error_label %} {{ error_label }} {% endif %} {# Body message #} {% if body %}

{{ body }}

{% endif %} {# Expandable exception block with sticky toolbar + copy button #} {% if exception is defined and exception %}
{{ exception.__class__.__name__ | to_spaced_camel_case | default("Exception") }} {{ exception | default("An unhandled exception occurred.") }} {% if exception.__traceback__ %}
Traceback
{{ expand_exception(exception) | default("Traceback not retrievable") }}
{% endif %}
{% endif %} {# Debug mode notice — only when DEBUG=True #} {% if debug %}
You are seeing this page because DEBUG=True is set. Switch to DEBUG=False to show the standard response.
{% endif %} {# Navigation actions — Go Back (primary) and Go Home (secondary) #} {% endblock main %}
{# Slot for child templates to inject page-specific styles and scripts #} {% block extra %}{% endblock %}