Skip to content

Commit

Permalink
fix: linter error logger.error -> logger.exception
Browse files Browse the repository at this point in the history
Signed-off-by: Felix Kaechele <felix@kaechele.ca>
  • Loading branch information
kaechele committed Aug 11, 2023
1 parent a52dfe8 commit 9db4caa
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/bonaparte/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,8 @@ async def _ensure_connected(self) -> None:
"""Connect to the device and ensure we stay connected."""
if self._connect_lock.locked():
_LOGGER.debug(
(
"[%s]: Connection already in progress, waiting for it to complete;"
" RSSI: %s"
),
"[%s]: Connection already in progress, waiting for it to complete;"
" RSSI: %s",
self.name,
self.rssi,
)
Expand Down Expand Up @@ -343,22 +341,19 @@ async def _execute(
)
if self._write_lock.locked():
_LOGGER.debug(
(
"[%s]: Operation already in progress, waiting for it to complete;"
" RSSI: %s"
),
"[%s]: Operation already in progress, waiting for it to complete;"
" RSSI: %s",
self.name,
self.rssi,
)
async with self._write_lock:
try:
return await self._execute_locked(message)
except BleakNotFoundError:
_LOGGER.error(
_LOGGER.exception(
"[%s]: device not found, no longer in range, or poor RSSI: %s",
self.name,
self.rssi,
exc_info=True,
)
raise
except CharacteristicMissingError as ex:
Expand Down

0 comments on commit 9db4caa

Please # to comment.