Skip to content
This repository has been archived by the owner on May 4, 2023. It is now read-only.

Commit

Permalink
updated exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Trevor Phillips committed Nov 8, 2020
1 parent 88646e4 commit 37778a1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
12 changes: 2 additions & 10 deletions blizzardapi/api.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import requests
from requests.exceptions import RequestException

from .exceptions import (
BlizzardApiRequestException,
BlizzardApiResponseExeception,
)
from .exceptions import BlizzardApiRequestException


class Api:
Expand Down Expand Up @@ -37,12 +34,7 @@ def _get_client_token(self, region):
return self._response_handler(response)

def _response_handler(self, response):
try:
json = response.json()
except Exception as e:
raise BlizzardApiResponseExeception(str(e))

return json
return response.json()

def _request_handler(self, url, region, query_params):
if self._access_token is None:
Expand Down
4 changes: 0 additions & 4 deletions blizzardapi/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,3 @@ class BlizzardApiException(Exception):

class BlizzardApiRequestException(BlizzardApiException):
pass


class BlizzardApiResponseExeception(BlizzardApiException):
pass

0 comments on commit 37778a1

Please sign in to comment.