Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix error message parsing.

  • Loading branch information...
commit 138c6ceb1e533010096ebdc2540ec7a87c7f6328 1 parent 28e975b
@BonsaiDen BonsaiDen authored joshthecoder committed
Showing with 3 additions and 2 deletions.
  1. +1 −1  tweepy/binder.py
  2. +2 −1  tweepy/parsers.py
View
2  tweepy/binder.py
@@ -155,7 +155,7 @@ def execute(self):
self.api.last_response = resp
if resp.status != 200:
try:
- error_msg = self.api.parser.parse_error(self, resp.read())
+ error_msg = self.api.parser.parse_error(resp.read())
except Exception:
error_msg = "Twitter error response: status code = %s" % resp.status
raise TweepError(error_msg, resp)
View
3  tweepy/parsers.py
@@ -45,7 +45,8 @@ def parse(self, method, payload):
return json
def parse_error(self, payload):
- return self.json_lib.loads(payload)['error']
+ error = self.json_lib.loads(payload)
+ return error['error'] if error.has_key('error') else error['errors']
class ModelParser(JSONParser):
Please sign in to comment.
Something went wrong with that request. Please try again.