mirror of
https://github.com/nesquena/hermes-webui.git
synced 2026-07-14 11:40:44 +00:00
2cee44b1b2
Extract _safe_write() helper that wraps end_headers() + wfile.write() in try/except (BrokenPipeError, ConnectionResetError, ConnectionAbortedError, TimeoutError, ssl.SSLError). Both j() and t() now use _safe_write() instead of raw wfile calls. Fixes cascading BrokenPipeError + SSL BAD_LENGTH crash when a client disconnects mid-response and the error handler tries to write a 500 status through the same broken socket.