Last active
August 29, 2015 14:08
-
-
Save CatoLynx/1bca4d275c99976f9815 to your computer and use it in GitHub Desktop.
Catch only a specific APIError and let others through
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def catch_only_rate_limit(): | |
try: | |
do_some_twitter_stuff() | |
except tweetpony.APIError as error: | |
if error.code == 88: | |
print "Oops, rate limited!" | |
else: | |
raise |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment