MCPcopy Create free account
hub / github.com/CodeClash-ai/CodeClash / error_page

Function error_page

codeclash/replay/serve.py:44–53  ·  view source on GitHub ↗
(game, exc)

Source from the content-addressed store, hash-verified

42 return base.build_page(renderer.parse(base.read_sim(game), tour.players), payload, renderer)
43
44 def error_page(game, exc) -> str:
45 source = game.member or (game.path.name if game.path else "?")
46 return (
47 '<!doctype html><meta charset="utf-8">'
48 "<body style='background:#0d1117;color:#e6edf3;font:14px system-ui;padding:24px'>"
49 f"<h2>Couldn't render round {game.round}, sim {game.sim}</h2>"
50 f"<p style='color:#8b949e'>source: <code>{html.escape(source)}</code></p>"
51 f"<pre style='color:#e5484d;white-space:pre-wrap'>{html.escape(type(exc).__name__)}: {html.escape(str(exc))}</pre>"
52 "<p><a style='color:#58a6ff' href='/'>&larr; back to index</a></p></body>"
53 )
54
55 class Handler(BaseHTTPRequestHandler):
56 def do_GET(self):

Callers 1

do_GETMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected