Giter Club home page Giter Club logo

redditstorybot's People

Contributors

itsmartin avatar

Watchers

 avatar

redditstorybot's Issues

Not handling HTTPError properly

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "RedditStoryBot.py", line 209, in <module>
    RedditStoryBot().main()
  File "RedditStoryBot.py", line 67, in main
    self.log.error("HTTP error occurred: " + err.reason)
AttributeError: 'HTTPError' object has no attribute 'reason'
sys:1: ResourceWarning: unclosed <socket.socket fd=7, family=AddressFamily.AF_INET, type=2049, proto=6, laddr=('178.62.62.232', 35796), raddr=('198.41.209.140', 80)>
/usr/lib/python3.4/importlib/_bootstrap.py:2127: ImportWarning: sys.meta_path is empty
sys:1: ResourceWarning: unclosed <ssl.SSLSocket fd=6, family=AddressFamily.AF_INET, type=2049, proto=6, laddr=('178.62.62.232', 56694), raddr=('198.41.209.140', 443)>
Crashed, restarting
Traceback (most recent call last):
  File "RedditStoryBot.py", line 209, in <module>
    RedditStoryBot().main()
  File "RedditStoryBot.py", line 16, in __init__
    self._initReddit()
  File "RedditStoryBot.py", line 56, in _initReddit
    self.reddit.login(config.username,config.password)
  File "/usr/local/lib/python3.4/dist-packages/praw-2.1.20-py3.4.egg/praw/__init__.py", line 1330, in login
    self.request_json(self.config['login'], data=data)
  File "/usr/local/lib/python3.4/dist-packages/praw-2.1.20-py3.4.egg/praw/decorators.py", line 163, in wrapped
    return_value = function(reddit_session, *args, **kwargs)
  File "/usr/local/lib/python3.4/dist-packages/praw-2.1.20-py3.4.egg/praw/__init__.py", line 557, in request_json
    retry_on_error=retry_on_error)
  File "/usr/local/lib/python3.4/dist-packages/praw-2.1.20-py3.4.egg/praw/__init__.py", line 399, in _request
    _raise_response_exceptions(response)
  File "/usr/local/lib/python3.4/dist-packages/praw-2.1.20-py3.4.egg/praw/internal.py", line 178, in _raise_response_exceptions
    response.raise_for_status()
  File "/usr/local/lib/python3.4/dist-packages/requests-2.5.1-py3.4.egg/requests/models.py", line 831, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 503 Server Error: Service Unavailable

Add an alternate response for users with no prior submissions

Example for /r/gametales

[USER] has posted their first Game Tale! In celebration of this once-in-a-lifetime event, they win a fabulous prize of [RANDOM PRIZE]!*

*In accordance with the nature of this subreddit, prize offered is 100% fictional.

a chrome toaster
a brand new washing machine
a speedboat
a microwave oven
a state-of-the-art hi-fi system 
a home computer
a cassette deck
a VCR
an all-inclusive trip for two to Paris
an Austin Allegro
a weekend in Blackpool
a teasmade
a carriage clock
a 14 inch portable television set
a hamburger-shaped telephone
a set of gold coloured biros
a set of travel luggage
a trouser press
a Wedgewood dinner service
a set of Encyclopedias

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.