rename 'StopExtraction' to 'AbortExtraction'

for cases where StopExtraction was used to report errors
This commit is contained in:
Mike Fährmann
2025-07-09 21:07:28 +02:00
parent f17ed0569a
commit d8ef1d693f
57 changed files with 149 additions and 156 deletions

View File

@@ -507,7 +507,8 @@ class RedditAPI():
try:
data = response.json()
except ValueError:
raise exception.StopExtraction(text.remove_html(response.text))
raise exception.AbortExtraction(
text.remove_html(response.text))
if "error" in data:
if data["error"] == 403:
@@ -515,7 +516,7 @@ class RedditAPI():
if data["error"] == 404:
raise exception.NotFoundError()
self.log.debug(data)
raise exception.StopExtraction(data.get("message"))
raise exception.AbortExtraction(data.get("message"))
return data
def _pagination(self, endpoint, params):