Skip to content

Commit 3c40be3

Browse files
committed
Limit intermediate exception logging
Don't log exceptions in the intermediate steps of the device setup process, as they are expected to fail and will be logged in the caller. Just raise them up to be handled by the caller.
1 parent 7cdab8c commit 3c40be3

1 file changed

Lines changed: 5 additions & 12 deletions

File tree

custom_components/winix/manager.py

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -120,20 +120,13 @@ async def prepare_devices_wrappers(
120120
id_tok = id_token or self._auth_response.id_token
121121
uuid = WinixAccount(token).get_uuid()
122122

123-
try:
124-
device_stubs = await Helpers.get_device_stubs(self._client, token, uuid)
125-
except Exception as err:
126-
LOGGER.error("Failed to get device stubs: %s", err, exc_info=True)
127-
raise
123+
# Don't log the failure exceptions here, they are logged in the caller. Just raise them up.
124+
device_stubs = await Helpers.get_device_stubs(self._client, token, uuid)
128125

129126
# boto3 call must run in an executor thread (synchronous I/O).
130-
try:
131-
identity_id = await self.hass.async_add_executor_job(
132-
Helpers.get_identity_id_sync, id_tok
133-
)
134-
except Exception as err:
135-
LOGGER.error("Failed to get identity_id: %s", err, exc_info=True)
136-
raise
127+
identity_id = await self.hass.async_add_executor_job(
128+
Helpers.get_identity_id_sync, id_tok
129+
)
137130

138131
if device_stubs:
139132
for device_stub in device_stubs:

0 commit comments

Comments
 (0)