Skip to content

fix(web): render a 404 and a 500 inside the app's layout, with a link to the runs - #393

Merged
harenome merged 1 commit into
ThinkFlowLab:mainfrom
harenome:fix/error-pages
Nov 24, 2026
Merged

harenome merged 1 commit into
ThinkFlowLab:mainfrom
harenome:fix/error-pages

Conversation

@harenome

@harenome harenome commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #389

What

A 404 and a 500 render error.html: the app's layout, the page head ("Not found" or "Server error") and a link back to Runs, in the user's theme. A 500 shows nothing of the error. Flask's unstyled default page is gone. The handlers sit with the page context in web/filters.py; on an error page the context skips ?workspace=, because an unknown workspace is itself a 404 and would fail the error page again.

Touches

routes · templates and static

Before and after

Before After
before-404-light after-404-light
before-404-dark after-404-dark

Rows: /no-such-page in light; in dark.

Verified

  • Backend suite (2856) and route suite (661), in a clean container.
  • New route test: /no-such-page, /job/no-such-job and /job/<job>?workspace=gone answer 404 inside the layout with the Runs link; a view that raises answers 500 inside the layout without the exception's text.
  • Chromium at 1280 px, light and dark: before, both URLs gave a transparent body, no navigation, "Not Found"; after, the theme's background, the navigation, "Not found" and the Runs link.

Risk

Every 404, a JSON route's included, now renders the full layout instead of Flask's page; a script reading only the status is unaffected. If the layout itself fails, Werkzeug's plain 500 is what remains. Undone by a revert.

… to the runs

Both show their title and the way back to Runs, in the user's theme; a 500 never shows the error. The page does not read ?workspace= again, since an unknown one may be what failed.
@harenome
harenome merged commit 15b5ca1 into ThinkFlowLab:main Nov 24, 2026
2 checks passed
@harenome
harenome deleted the fix/error-pages branch November 24, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error pages: a 404 shows Flask's unstyled default, outside the app's layout

1 participant