feat(UI): initial working frontend UI
This commit is contained in:
@@ -386,6 +386,18 @@ class RedditConnector(metaclass=ABCMeta):
|
||||
generators.append(self.reddit_instance.redditor(user).saved(limit=self.args.limit))
|
||||
except prawcore.PrawcoreException as e:
|
||||
logger.error(f"User {user} failed to be retrieved due to a PRAW exception: {e}")
|
||||
# Detect HTTP 429 (rate limiting) and propagate as a hard failure so the UI can show 'failed'
|
||||
TooManyRequests = getattr(prawcore.exceptions, "TooManyRequests", None)
|
||||
is_rate_limited = False
|
||||
if TooManyRequests is not None and isinstance(e, TooManyRequests):
|
||||
is_rate_limited = True
|
||||
elif (hasattr(e, "response") and getattr(e.response, "status_code", None) == 429) or "429" in str(e):
|
||||
is_rate_limited = True
|
||||
|
||||
if is_rate_limited:
|
||||
logger.error("Received HTTP 429 (rate limited). Propagating error to fail the download.")
|
||||
raise
|
||||
|
||||
logger.debug("Waiting 60 seconds to continue")
|
||||
sleep(60)
|
||||
return generators
|
||||
|
||||
Reference in New Issue
Block a user