mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
Raise exception on unhandled responses
This commit is contained in:
parent
f42dc376bf
commit
11ad173e81
1 changed files with 4 additions and 1 deletions
|
@ -13,4 +13,7 @@ async def get_player_data(platform: str, region: str, battletag: str, **kwargs):
|
||||||
if r.status_code == 200:
|
if r.status_code == 200:
|
||||||
return r.json()
|
return r.json()
|
||||||
elif r.status_code == 404:
|
elif r.status_code == 404:
|
||||||
raise Exception("Player not found.")
|
raise Exception("Player not found.")
|
||||||
|
else:
|
||||||
|
raise Exception("Unhandled API response.")
|
||||||
|
|
Loading…
Reference in a new issue