Skip to content

Commit e2f4a88

Browse files
authored
Improved error messages.
1 parent fd8b635 commit e2f4a88

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/downloader/jobs/fetch_data_worker.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def _fetch_data(self, url: str, valid_hash: Optional[str], valid_size: Optional[
6666
return buf, None
6767

6868
except socket.gaierror as e: return None, FileDownloadError(f'Socket Address Error! {url}: {str(e)}', e)
69+
except socket.timeout as e: return None, FileDownloadError(f'Socket Connection Timed Out! {url}: {str(e)}', e)
6970
except URLError as e: return None, FileDownloadError(f'URL Error! {url}: {e.reason}', e)
7071
except HTTPException as e: return None, FileDownloadError(f'HTTP Error! {url}: {str(e)}', e)
7172
except ConnectionResetError as e: return None, FileDownloadError(f'Connection reset error! {url}: {str(e)}', e)

src/downloader/jobs/fetch_file_worker.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def fetch_file(self, url: str, download_path: str) -> tuple[int, str, Optional[F
8787
file_size, file_hash = self._file_system.write_incoming_stream(in_stream, download_path, self._timeout)
8888

8989
except socket.gaierror as e: return 0, '', FileDownloadError(f'Socket Address Error! {url}: {str(e)}', e)
90+
except socket.timeout as e: return 0, '', FileDownloadError(f'Socket Connection Timed Out! {url}: {str(e)}', e)
9091
except URLError as e: return 0, '', FileDownloadError(f'URL Error! {url}: {e.reason}', e)
9192
except HTTPException as e: return 0, '', FileDownloadError(f'HTTP Error! {url}: {str(e)}', e)
9293
except ConnectionResetError as e: return 0, '', FileDownloadError(f'Connection reset error! {url}: {str(e)}', e)

0 commit comments

Comments
 (0)