pseudonym117 / Riot-Watcher

Simple Python wrapper for the Riot Games API for League of Legends
MIT License
532 stars 150 forks source link

Error 403 when the user does not have a tier #169

Closed luagugus closed 3 years ago

luagugus commented 3 years ago

my_ranked_stats = watcher.league.by_summoner(my_region, me['id'])

If the user's league information is imported like this, but there is no tier of the user you are trying to import, a 403 error will appear. Are there any solutions or methods for this?

pseudonym117 commented 3 years ago

A 403 generally indicates that either your api key is invalid or that you are trying to access an invalid endpoint.

If me[id] contains a / character, reopen this ticket with exactly what that field is. Otherwise, this is almost certainly due to an expired (or blacklisted) api key.

luagugus commented 3 years ago

It can be done by reissue

Thank you

luagugus commented 3 years ago

There are no 403 errors after reissuance, but it seems that exception handling for users without tiers is not allowed.

if my_ranked_stats[1]['tier'] == None:

Can I do this or should I do it differently?