Handle Connection Errors
See original GitHub issueIssue Description
If running collection for a historical period, often the connection is dropped with timeout errors for me. I’ve tried on my local machine and a server which is always on. Some simple error handling and requesting the same item (comment/post) again would be good.
Paste of code since GitHub formatted it poorly: https://pastebin.com/pNUpgJXL
Errors raised:
raise ReadTimeoutError(self, url, "Read timed out. (read timeout=%s)" % timeout_value) urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='www.reddit.com', port=443): Read timed out. (read timeout=16.0)
Followed by
raise ReadTimeout(e, request=request) requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='www.reddit.com', port=443): Read timed out. (read timeout=16.0)
followed by
raise RequestException(exc, args, kwargs) prawcore.exceptions.RequestException: error with request HTTPSConnectionPool(host='www.reddit.com', port=443): Read timed out. (read timeout=16.0)
System Information
PRAW Version: 5.3.0
Python Version: 3.6.3 Operating System: OS X 10.13 || Ubuntu 16.04
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
I believe https://github.com/praw-dev/prawcore/pull/64 closes this.
For future reference you can triple quote the block like: