Skip to content

Commit 8b46dd8

Browse files
committed
Create RateLimitExceededException
1 parent 9249f6f commit 8b46dd8

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

xbox/webapi/common/exceptions.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"""
44

55

6+
from xbox.webapi.common.ratelimits import RateLimit
7+
8+
69
class XboxException(Exception):
710
"""Base exception for all Xbox exceptions to subclass"""
811

@@ -46,3 +49,10 @@ class NotFoundException(XboxException):
4649
"""Any exception raised due to a resource being missing will subclass this"""
4750

4851
pass
52+
53+
54+
class RateLimitExceededException(XboxException):
55+
def __init__(self, message, rate_limit: RateLimit):
56+
self.message = message
57+
self.rate_limit = rate_limit
58+
self.try_again_in = rate_limit.get_reset_after()

0 commit comments

Comments
 (0)