Fixed TypeError #364

Merged
miratcan merged 1 commit from master into master 2014-12-16 09:58:52 -08:00
miratcan commented 2014-12-16 05:51:57 -08:00 (Migrated from github.com)

In some cases Twitter API returns only one error like this

{u'errors': u'sharing is not permissible for this status (Share validations failed)'}

But _get_error_message at api.py trying to catch 0th error message on response:

line 216 at api.py
error_message = content['errors'][0]['mesage']

That raises: TypeError: string indices must be integers

So i added an exception to handle this case. I'm waiting for your comments. Can we merge it to master?

In some cases Twitter API returns only one error like this ``` {u'errors': u'sharing is not permissible for this status (Share validations failed)'} ``` But _get_error_message at api.py trying to catch 0th error message on response: ``` line 216 at api.py error_message = content['errors'][0]['mesage'] ``` That raises: TypeError: string indices must be integers So i added an exception to handle this case. I'm waiting for your comments. Can we merge it to master?
coveralls commented 2014-12-16 05:55:23 -08:00 (Migrated from github.com)

Coverage Status

Coverage decreased (-0.18%) when pulling 14526cb3df on miratcan:master into 38328e77ad on ryanmcgrath:master.

[![Coverage Status](https://coveralls.io/builds/1618890/badge)](https://coveralls.io/builds/1618890) Coverage decreased (-0.18%) when pulling **14526cb3df40f334428a27d91985a4a7357a8108 on miratcan:master** into **38328e77ade997b0e21a04d4439fbf3d07ae432e on ryanmcgrath:master**.
michaelhelmick commented 2014-12-16 09:58:56 -08:00 (Migrated from github.com)

Thanks for this!

Thanks for this!
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: code/twython#364
No description provided.