Adding exception msgs
This commit is contained in:
@@ -44,7 +44,7 @@ class FplApi(object):
|
||||
js = json.loads(await response.text())
|
||||
|
||||
if response.reason == "Unauthorized":
|
||||
return js["messageCode"]
|
||||
raise Exception(js["messageCode"])
|
||||
|
||||
if js["messages"][0]["messageCode"] != "login.success":
|
||||
_LOGGER.error(f"Logging Failure")
|
||||
|
||||
@@ -45,8 +45,8 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
|
||||
async_add_entities(fpl_accounts)
|
||||
|
||||
except Exception: # pylint: disable=broad-except
|
||||
pass
|
||||
except Exception as e: # pylint: disable=broad-except
|
||||
_LOGGER.error(f"Adding fpl accounts: {e}")
|
||||
|
||||
await session.close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user