Skip to content

Commit a9d91de

Browse files
committed
Fix error handling in arxiv_fetch.py to raise QuantifyingException
1 parent 76d2184 commit a9d91de

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

scripts/1-fetch/arxiv_fetch.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,9 +597,12 @@ def query_arxiv(args):
597597
# arXiv recommends a 3-seconds delay between consecutive
598598
# api calls for efficiency
599599
time.sleep(3)
600+
except requests.HTTPError as e:
601+
raise shared.QuantifyingException(f"HTTP Error: {e}", 1)
600602
except requests.RequestException as e:
601-
LOGGER.error(f"Request failed: {e}")
602-
break
603+
raise shared.QuantifyingException(f"Request Exception: {e}", 1)
604+
except KeyError as e:
605+
raise shared.QuantifyingException(f"KeyError: {e}", 1)
603606

604607
if papers_found_in_batch == 0:
605608
break

0 commit comments

Comments
 (0)