Commit Graph
4 Commits
Author SHA1 Message Date
4c5e0af4d2 fix(server): make request logging non-fatal so a closed stdout can't abort a response (#4188) (#4235)
* Make request logging nonfatal

* chore(release): stamp v0.51.431 (Release OR) for #4188

---------

Co-authored-by: MC <mchughson@sportsculture.io>
Co-authored-by: nesquena-hermes <agent@nesquena-hermes>
2026-06-15 00:28:51 -07:00
Ed 79f526b1b2 fix(helpers): use ssl.SSLError instead of broad OSError in disconnect tuple
OSError is too broad — it masks real errors like file-not-found.
ssl.SSLError specifically catches SSL-level disconnects without
swallowing unrelated OSError subtypes.

Closes the test_excludes_broad_oserror CI failure.
2026-05-31 01:56:39 +00:00
Ed 59b7a3ac94 fix: eliminate silent failures in client disconnect handling
- api/helpers.py: _safe_write() now logs disconnects at debug level
  instead of silently passing. No more invisible errors.

- server.py: Restructure exception handlers to catch
  _CLIENT_DISCONNECT_ERRORS first, then Exception. Remove the
  isinstance() filter inside except Exception (LBYL anti-pattern).
  The 500-response fallback now catches _CLIENT_DISCONNECT_ERRORS
  separately (expected) and logs unexpected failures via
  traceback.print_exc() instead of bare except Exception: pass.

- tests/test_broken_pipe_cascade.py: Add coverage for SSL/Timeout
  disconnect routing and 500-response safety (both disconnect
  survival and unexpected error logging).
2026-05-31 01:56:39 +00:00
someaka e531a05e60 fix(server): catch client disconnect errors in response write path 2026-05-31 01:56:39 +00:00