fix: board 404 returns clean page, not 500
CI / test (push) Failing after 3s
CI / lint (push) Failing after 4s

- board.py: catch httpx.HTTPStatusError 404 and show 'Projet introuvable' page
- all functional tests pass: dashboard (50 unique), board, issues, checklists, notes, CSRF
This commit is contained in:
2026-07-08 09:37:51 -04:00
parent 69803c4c4a
commit e72c0dcbd8
+8
View File
@@ -95,6 +95,14 @@ async def board(
column_map[col].append(issue)
except Exception as e:
from httpx import HTTPStatusError
if isinstance(e, HTTPStatusError) and e.response is not None and e.response.status_code == 404:
html = '<div style="padding:48px;text-align:center">'
html += '<h2 style="color:var(--text-dim)">Projet introuvable</h2>'
html += f'<p style="color:var(--text-dim)">{owner}/{repo} n\'existe pas sur Gitea.</p>'
html += '<a href="/" class="btn btn-primary" style="margin-top:16px">Retour aux projets</a>'
html += '</div>'
return HTMLResponse(html, status_code=404)
logger.error("Board error: %s", e)
return HTMLResponse(f"<p class='error'>Erreur: {e}</p>", status_code=500)