Skip to content

Commit

Permalink
Catch ClientError and raise CannotConnect
Browse files Browse the repository at this point in the history
  • Loading branch information
tronikos committed Oct 11, 2024
1 parent c5d50cd commit f015bf3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "opower"
version = "0.8.2"
version = "0.8.3"
license = {text = "Apache-2.0"}
authors = [
{ name="tronikos", email="tronikos@gmail.com" },
Expand Down
4 changes: 3 additions & 1 deletion src/opower/opower.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from urllib.parse import urlencode

import aiohttp
from aiohttp.client_exceptions import ClientResponseError
from aiohttp.client_exceptions import ClientError, ClientResponseError
import aiozoneinfo
import arrow

Expand Down Expand Up @@ -205,6 +205,8 @@ async def async_login(self) -> None:
raise InvalidAuth(err)
else:
raise CannotConnect(err)
except ClientError as err:
raise CannotConnect(err)

async def async_get_accounts(self) -> list[Account]:
"""Get a list of accounts for the signed in user.
Expand Down

0 comments on commit f015bf3

Please sign in to comment.