Commit 91567658 authored by Josh Roesslein's avatar Josh Roesslein
Browse files

Handle failures during send of request to twitter. This mainly happens if we...

Handle failures during send of request to twitter. This mainly happens if we are unable to connect to twitter due to network outage or twitter being offline.
parent d4a5bda7
......@@ -110,7 +110,10 @@ def bind_api(path, parser, allowed_param=[], method='GET', require_auth=False,
)
# Build request
conn.request(method, url, headers=headers, body=post_data)
try:
conn.request(method, url, headers=headers, body=post_data)
except Exception, e:
raise TweepError('Failed to send request: %s' % e)
# Get response
resp = conn.getresponse()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment