Skip to content

Commit 0638666

Browse files
committed
handle more network errors
```python-traceback Traceback (most recent call last): File ".local/bin/github-backup", line 6, in <module> sys.exit(main()) ~~~~^^ File ".local/share/pipx/venvs/github-backup/lib/python3.14/site-packages/github_backup/cli.py", line 83, in main backup_repositories(args, output_directory, repositories) ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".local/share/pipx/venvs/github-backup/lib/python3.14/site-packages/github_backup/github_backup.py", line 1845, in backup_repositories backup_pulls(args, repo_cwd, repository, repos_template) ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File ".local/share/pipx/venvs/github-backup/lib/python3.14/site-packages/github_backup/github_backup.py", line 2019, in backup_pulls pulls[number]["commit_data"] = retrieve_data(args, template) ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^ File ".local/share/pipx/venvs/github-backup/lib/python3.14/site-packages/github_backup/github_backup.py", line 766, in retrieve_data return list(fetch_all()) File ".local/share/pipx/venvs/github-backup/lib/python3.14/site-packages/github_backup/github_backup.py", line 717, in fetch_all response = json.loads(http_response.read().decode("utf-8")) ~~~~~~~~~~~~~~~~~~^^ File "/usr/lib/python3.14/http/client.py", line 500, in read s = self._safe_read(self.length) File "/usr/lib/python3.14/http/client.py", line 648, in _safe_read data = self.fp.read(cursize) File "/usr/lib/python3.14/socket.py", line 725, in readinto return self._sock.recv_into(b) ~~~~~~~~~~~~~~~~~~~~^^^ File "/usr/lib/python3.14/ssl.py", line 1304, in recv_into return self.read(nbytes, buffer) ~~~~~~~~~^^^^^^^^^^^^^^^^ File "/usr/lib/python3.14/ssl.py", line 1138, in read return self._sslobj.read(len, buffer) ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^ ConnectionResetError: [Errno 104] Connection reset by peer ```
1 parent f8cdf55 commit 0638666

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

github_backup/github_backup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,7 @@ def _extract_legal_url(response_body_bytes):
806806
response = json.loads(http_response.read().decode("utf-8"))
807807
break # Exit retry loop and handle the data returned
808808
except (
809+
ConnectionError,
809810
IncompleteRead,
810811
json.decoder.JSONDecodeError,
811812
TimeoutError,

0 commit comments

Comments
 (0)