소스 검색

Catch other connection errors

master
JustAnotherArchivist 2 년 전
부모
커밋
7f25c092d1
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. +1
    -1
      ia-cdx-search

+ 1
- 1
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()


불러오는 중...
취소
저장