Skip to content

Commit

Permalink
deprecating old features, raise an Exception when over limit
Browse files Browse the repository at this point in the history
  • Loading branch information
nanorepublica committed Jan 28, 2016
1 parent b2c72d1 commit 461b1ad
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 1,314 deletions.
7 changes: 6 additions & 1 deletion duedil/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@
}
API_KEY = os.environ.get('DUEDIL_API_KEY', None)

class APILimitException(Exception):
pass

class APIMonthlyLimitException(APILimitException):
pass

def retry_throttling(exception):
if isinstance(exception, HTTPError):
Expand All @@ -60,7 +65,7 @@ def retry_throttling(exception):
if 'Developer Over Qps' in exception.response.text:
return True
elif 'Developer Over Rate' in exception.response.text:
return True
raise APIMonthlyLimitException('Monthly Limit reached for Duedil calls')
return False


Expand Down

0 comments on commit 461b1ad

Please sign in to comment.