From 7f25c092d14367e72eafb144343494ffbe44613c Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Fri, 19 Nov 2021 01:32:25 +0000 Subject: [PATCH] Catch other connection errors --- ia-cdx-search | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ia-cdx-search b/ia-cdx-search index 550180f..e449480 100755 --- a/ia-cdx-search +++ b/ia-cdx-search @@ -36,7 +36,7 @@ def fetch(url, tries, connection): print(f'Read {len(data)} bytes from {url}', file = sys.stderr) o = json.loads(data) break - except (RuntimeError, TimeoutError, socket.timeout, ConnectionResetError, http.client.HTTPException, json.JSONDecodeError) as e: + except (RuntimeError, TimeoutError, socket.timeout, ConnectionError, http.client.HTTPException, json.JSONDecodeError) as e: # socket.timeout is an alias of TimeoutError from Python 3.10 but still needs to be caught explicitly for older versions print(f'Error retrieving {url}: {type(e).__module__}.{type(e).__name__} {e!s}', file = sys.stderr) connection.close()