Skip to content

Commit 849e105

Browse files
committed
fix: don't throw error on 404
If there are 404 on trying to download job content, we want to silently skip this job and continue to collect data about other jobs. Since this patch, `raise_for_error()` doesn't call for `requests.exceptions.HTTPError: 404 Client Error`.
1 parent 497bfd7 commit 849e105

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

multivac/fetch.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ def http_get(url, params=None):
9696
else:
9797
fmt = '[Don\'t log response with unknown Content-Type: {}]'
9898
response_text = fmt.format(content_type)
99-
r.raise_for_status()
99+
if r.status_code != 404:
100+
r.raise_for_status()
101+
else:
102+
info(f"======================ERROR 404 FOR URL======================\n{url}")
100103
else:
101104
response_text = '[EMPTY LOG!]'
102105

0 commit comments

Comments
 (0)