Skip to content

Commit 5c48e52

Browse files
committed
raise QuantifyingException for failed category fetch instead of returning none
1 parent c055c47 commit 5c48e52

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/1-fetch/wikicommons_fetch.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,9 @@ def fetch_category_totals(category, session):
131131
page_cnt += catinfo.get("pages", 0)
132132
return {"FILE_COUNT": file_cnt, "PAGE_COUNT": page_cnt}
133133
except Exception as e:
134-
LOGGER.warning(f"Failed to fetch contents for {category}: {e}")
135-
return {"FILE_COUNT": None, "PAGE_COUNT": None}
134+
message = f"Failed to fetch contents for {category}: {e}"
135+
LOGGER.error(message)
136+
raise shared.QuantifyingException(message, exit_code=1)
136137

137138

138139
def recursive_collect_data(session, limit=None):

0 commit comments

Comments
 (0)