Skip to content

Commit 16959ac

Browse files
committed
Remove unnecessary code
1 parent cfd081e commit 16959ac

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

pyhilo/oauth2.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
from homeassistant.helpers.aiohttp_client import async_create_clientsession
99
from aiohttp import CookieJar
10+
1011
from pyhilo.const import AUTH_AUTHORIZE, AUTH_CLIENT_ID, AUTH_TOKEN, DOMAIN
1112
from pyhilo.oauth2helper import OAuth2Helper
1213

@@ -61,12 +62,5 @@ async def _token_request(self, data: dict) -> dict:
6162
data["client_secret"] = self.client_secret
6263

6364
resp = await self.session.post(self.token_url, data=data)
64-
if resp.status >= 400:
65-
try:
66-
error_response = await resp.json()
67-
except (ClientError, JSONDecodeError):
68-
error_response = {}
69-
error_code = error_response.get("error", "unknown")
70-
error_description = error_response.get("error_description", "unknown error")
7165
resp.raise_for_status()
7266
return cast(dict, await resp.json())

0 commit comments

Comments
 (0)