Merge pull request #143 from gdevanla/update_error_code
Update error code to 429 - (to catch rate limit exceptions)
This commit is contained in:
commit
2bbed505d5
1 changed files with 2 additions and 1 deletions
|
|
@ -206,7 +206,8 @@ class Twython(object):
|
||||||
'error', 'An error occurred processing your request.')
|
'error', 'An error occurred processing your request.')
|
||||||
self._last_call['api_error'] = error_msg
|
self._last_call['api_error'] = error_msg
|
||||||
|
|
||||||
exceptionType = TwythonRateLimitError if response.status_code == 420 else TwythonError
|
#Twitter API 1.1 , always return 429 when rate limit is exceeded
|
||||||
|
exceptionType = TwythonRateLimitError if response.status_code == 429 else TwythonError
|
||||||
|
|
||||||
raise exceptionType(error_msg,
|
raise exceptionType(error_msg,
|
||||||
error_code=response.status_code,
|
error_code=response.status_code,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue