You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Currently using Praw's reddit comments stream to monitor comments in the subreddit. When there is an issue with the stream or reddit like a 503 error the program just raises the exception and drops out
To Reproduce
Take reddit down I guess? I'm not interested in mocking a reddit client.
Expected behavior
The bot should be able to deal with reddit being down just like it deals with issues with making requests to Imgur.
Additional context
nohup.out log:
Setting up DB...
Done!
Looking for comments...
Traceback (most recent call last):
File "bot.py", line 250, in <module>
for comment in r.subreddit(SUBREDDIT_NAME).stream.comments():
File "/home/pi/.local/lib/python3.7/site-packages/praw/models/util.py", line 186, in stream_generator
for item in reversed(list(function(limit=limit, **function_kwargs))):
File "/home/pi/.local/lib/python3.7/site-packages/praw/models/listing/generator.py", line 61, in __next__
self._next_batch()
File "/home/pi/.local/lib/python3.7/site-packages/praw/models/listing/generator.py", line 71, in _next_batch
self._listing = self._reddit.get(self.url, params=self.params)
File "/home/pi/.local/lib/python3.7/site-packages/praw/reddit.py", line 490, in get
return self._objectify_request(method="GET", params=params, path=path)
File "/home/pi/.local/lib/python3.7/site-packages/praw/reddit.py", line 574, in _objectify_request
data=data, files=files, method=method, params=params, path=path
File "/home/pi/.local/lib/python3.7/site-packages/praw/reddit.py", line 732, in request
timeout=self.config.timeout,
File "/home/pi/.local/lib/python3.7/site-packages/prawcore/sessions.py", line 336, in request
url=url,
File "/home/pi/.local/lib/python3.7/site-packages/prawcore/sessions.py", line 235, in _request_with_retries
url,
File "/home/pi/.local/lib/python3.7/site-packages/prawcore/sessions.py", line 195, in _make_request
timeout=timeout,
File "/home/pi/.local/lib/python3.7/site-packages/prawcore/rate_limit.py", line 35, in call
kwargs["headers"] = set_header_callback()
File "/home/pi/.local/lib/python3.7/site-packages/prawcore/sessions.py", line 282, in _set_header_callback
self._authorizer.refresh()
File "/home/pi/.local/lib/python3.7/site-packages/prawcore/auth.py", line 352, in refresh
password=self._password,
File "/home/pi/.local/lib/python3.7/site-packages/prawcore/auth.py", line 149, in _request_token
response = self._authenticator._post(url, **data)
File "/home/pi/.local/lib/python3.7/site-packages/prawcore/auth.py", line 32, in _post
raise ResponseException(response)
prawcore.exceptions.ResponseException: received 503 HTTP response
[Sun 24 May 14:47:38 BST 2020] bot exited with code 1. restarting ...
The text was updated successfully, but these errors were encountered:
Describe the bug
Currently using Praw's reddit comments stream to monitor comments in the subreddit. When there is an issue with the stream or reddit like a 503 error the program just raises the exception and drops out
To Reproduce
Take reddit down I guess? I'm not interested in mocking a reddit client.
Expected behavior
The bot should be able to deal with reddit being down just like it deals with issues with making requests to Imgur.
Additional context
nohup.out log:
The text was updated successfully, but these errors were encountered: