Commit a4221e0
fix: handle ClosedResourceError when logging errors to disconnected clients
Wrap send_log_message() in _handle_message's exception handler with a
try/except for ClosedResourceError and BrokenResourceError. When a client
disconnects during request processing, the server catches the stream
exception but then crashes trying to send the error log back through the
already-closed write stream.
Closes #2064
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 62575ed commit a4221e0
1 file changed
+8
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
425 | 428 | | |
426 | 429 | | |
427 | 430 | | |
| |||
0 commit comments