fujisakifujita / python-twitter

Automatically exported from code.google.com/p/python-twitter
Apache License 2.0
0 stars 0 forks source link

Failed to catch twitter api errors (current code checks for error) #234

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Iterate on GetMentions till twitter server returns an error
2. The library raises an attribute exception
3.

What is the expected output? What do you see instead?

I expect to get a TwitterError exception
Instead I get an AttributeException

What version of the product are you using? On what operating system?

Linux, python-twitter version 0.8.2

Please provide any additional information below.

The problem is caused since server is returning json:
'{"errors":[{"message":"Internal error","code":131}]}'

while _CheckForTwitterError method is looking for 'error'
I suggest simply adding another check if 'errors' is in the returned json

Original issue reported on code.google.com by dan.jul...@gmail.com on 24 Jun 2012 at 9:59