1
Fork 0
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:
Steffo 2016-08-12 21:12:51 +02:00
parent f42dc376bf
commit 11ad173e81

View file

@ -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.")