Skip to content

Commit bb34f36

Browse files
alex-anthropicnjsmith
authored andcommitted
don't log oserror
1 parent 975d783 commit bb34f36

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/hypercorn/trio/tcp_server.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ def log_handler(e: Exception) -> None:
5454
self.config.log.error_logger.exception("Internal hypercorn error", exc_info=e)
5555

5656
try:
57-
with exceptiongroup.catch({Exception: log_handler}): # type: ignore
57+
with exceptiongroup.catch(
58+
{OSError: lambda e: None, Exception: log_handler} # type: ignore
59+
):
5860
client = parse_socket_addr(socket.family, socket.getpeername())
5961
server = parse_socket_addr(socket.family, socket.getsockname())
6062

0 commit comments

Comments
 (0)