Files
tidal-dl-ng-webui/env/lib/python3.11/site-packages/ratelimit/exception.py
2024-12-27 22:31:23 +09:00

16 lines
641 B
Python

class RateLimitException(Exception):
'''
Rate limit exception class.
'''
def __init__(self, message, period_remaining):
'''
Custom exception raise when the number of function invocations exceeds
that imposed by a rate limit. Additionally the exception is aware of
the remaining time period after which the rate limit is reset.
:param string message: Custom exception message.
:param float period_remaining: The time remaining until the rate limit is reset.
'''
super(RateLimitException, self).__init__(message)
self.period_remaining = period_remaining