Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError when reaching RateLimit #156

Open
Green222 opened this issue Jun 1, 2020 · 2 comments
Open

TypeError when reaching RateLimit #156

Green222 opened this issue Jun 1, 2020 · 2 comments

Comments

@Green222
Copy link

Green222 commented Jun 1, 2020

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'
@pseudonym117
Copy link
Owner

Yeah thats definitely a bug... did this happen on the very first request made to the summoner api?

@Green222
Copy link
Author

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) :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants