TypeError when reaching RateLimit
Green222 opened this issue · 2 comments
When reaching RateLimit, a TypeError was triggered.
It seems RiotWatcher is trying to compute the time needed to wait, but is missing one of the value to do so (maybe a value in Riot Headers not found?).
In any case, this should be handled as we are not supposed to catch a TypeError above.
Here is the traceback:
File "/usr/local/lib/python3.6/dist-packages/riotwatcher/_apis/league_of_legends/SummonerApiV4.py", line 49, in by_name
summoner_name=summoner_name,
File "/usr/local/lib/python3.6/dist-packages/riotwatcher/_apis/NamedEndpoint.py", line 36, in _request_endpoint
self._endpoint_name, method_name, region, url, query
File "/usr/local/lib/python3.6/dist-packages/riotwatcher/_apis/BaseApi.py", line 30, in raw_request
region, endpoint_name, method_name, url, query_params
File "/usr/local/lib/python3.6/dist-packages/riotwatcher/Handlers/RateLimiterAdapter.py", line 35, in preview_request
wait_until = self._limiter.wait_until(region, endpoint_name, method_name)
File "/usr/local/lib/python3.6/dist-packages/riotwatcher/Handlers/RateLimit/BasicRateLimiter.py", line 34, in wait_until
for limiter in self._limiters
File "/usr/local/lib/python3.6/dist-packages/riotwatcher/Handlers/RateLimit/BasicRateLimiter.py", line 34, in <listcomp>
for limiter in self._limiters
File "/usr/local/lib/python3.6/dist-packages/riotwatcher/Handlers/RateLimit/HeaderBasedLimiter.py", line 49, in wait_until
return scoped_limit.wait_until()
File "/usr/local/lib/python3.6/dist-packages/riotwatcher/Handlers/RateLimit/Limits.py", line 23, in wait_until
limits_waits = [limit.wait_until() for key, limit in self._limits.items()]
File "/usr/local/lib/python3.6/dist-packages/riotwatcher/Handlers/RateLimit/Limits.py", line 23, in <listcomp>
limits_waits = [limit.wait_until() for key, limit in self._limits.items()]
File "/usr/local/lib/python3.6/dist-packages/riotwatcher/Handlers/RateLimit/Limits.py", line 110, in wait_until
return self._start_time + datetime.timedelta(seconds=self.duration)
TypeError: unsupported operand type(s) for +: 'NoneType' and 'datetime.timedelta'
Yeah thats definitely a bug... did this happen on the very first request made to the summoner
api?
That happened when I reached rate limit on the summoner api, but not on the very first request.
I can also reproduce that issue most of the times by triggering the rate limit error multiple times, if that can help.
I am currently using a product key and not a dev key (not sure if that can make any difference) :)