Skip to content

Commit

Permalink
Merge pull request #55 from pyalarmdotcom/fix-134
Browse files Browse the repository at this point in the history
More logging around ContentTypeErrors.
  • Loading branch information
elahd authored Jul 20, 2022
2 parents 93eef5f + c6f0c8d commit 3928c7b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pyalarmdotcomajax/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
from .extensions import ConfigurationOption
from .extensions import ExtendedProperties

__version__ = "0.4"
__version__ = "0.4.1"


log = logging.getLogger(__name__)
Expand Down Expand Up @@ -844,6 +844,15 @@ async def _async_get_trouble_conditions(self) -> None:

self._trouble_conditions = trouble_all_devices

except aiohttp.ContentTypeError as err:
log.error(
"Server returned wrong content type. Response: %s\n\nResponse"
" Text:\n\n%s\n\n",
resp,
resp.text(),
)
raise DataFetchFailed from err

except (asyncio.TimeoutError, aiohttp.ClientError) as err:
log.error("Connection error while fetching trouble conditions.")
raise DataFetchFailed from err
Expand Down

0 comments on commit 3928c7b

Please sign in to comment.