From 11ad173e81df13f345e576010ef20c9873e5612a Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Fri, 12 Aug 2016 21:12:51 +0200 Subject: [PATCH] Raise exception on unhandled responses --- overwatch.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/overwatch.py b/overwatch.py index 2772fd2a..08a5648a 100644 --- a/overwatch.py +++ b/overwatch.py @@ -13,4 +13,7 @@ async def get_player_data(platform: str, region: str, battletag: str, **kwargs): if r.status_code == 200: return r.json() elif r.status_code == 404: - raise Exception("Player not found.") \ No newline at end of file + raise Exception("Player not found.") + else: + raise Exception("Unhandled API response.") + \ No newline at end of file