Fix error message reporting.
authorJosh Roesslein <jroesslein@gmail.com>
Wed, 14 Oct 2009 19:09:33 +0000 (14:09 -0500)
committerJosh Roesslein <jroesslein@gmail.com>
Wed, 14 Oct 2009 19:09:33 +0000 (14:09 -0500)
tweepy/binder.py

index 9097d75d32b804875ccc67bd446d29b60870fc71..3bf1bf50b8190ee190d04b625b101dc861a56fe9 100644 (file)
@@ -125,7 +125,7 @@ def bind_api(path, parser, allowed_param=[], method='GET', require_auth=False,
         api.last_response = resp
         if resp.status != 200:
             try:
-                error_msg = parse_error(resp.read())
+                error_msg = parse_error(json.loads(resp.read()))
             except Exception:
                 error_msg = "Twitter error response: status code = %s" % resp.status
             raise TweepError(error_msg)