Skip to content

TypeError when reaching RateLimit #156

@Green222

Description

@Green222

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions