Skip to content

Commit 7965224

Browse files
committed
Update rate limit response text and log message
Use Cisco Spark’s provided response code description, and shorten the log message given the updated response text.
1 parent 768f484 commit 7965224

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

ciscosparkapi/exceptions.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@
3333
409: "The request could not be processed because it conflicts with some "
3434
"established rule of the system. For example, a person may not be "
3535
"added to a room more than once.",
36-
429: "Rate limit exceeded.",
36+
429: "Too many requests have been sent in a given amount of time and the "
37+
"request has been rate limited. A Retry-After header should be "
38+
"present that specifies how many seconds you need to wait before a "
39+
"successful request can be made.",
3740
500: "Something went wrong on the server.",
3841
503: "Server is overloaded with requests. Try again later."
3942
}

ciscosparkapi/restsession.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,8 @@ def request(self, method, relative_url, erc, **kwargs):
267267
if e.response_code == RATE_LIMIT_EXCEEDED_RESPONSE_CODE \
268268
and response.headers.get('Retry-After'):
269269

270-
logger.debug("Received a [{}] {} response."
271-
"".format(e.response_code, e.response_text))
270+
logger.debug("Received a [%s] rate limit response. "
271+
"Attempting to retry.", e.response_code)
272272

273273
rate_limit_wait = response.headers['Retry-After']
274274

0 commit comments

Comments
 (0)