Skip to content

Commit

Permalink
[Fix] Reduce exceptions logging
Browse files Browse the repository at this point in the history
  • Loading branch information
melianmiko committed Sep 25, 2024
1 parent 662fad7 commit 028548c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion openfreebuds/driver/generic/spp.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ async def start(self):
sock.connect((self.device_address, self._spp_service_port))
reader, writer = await asyncio.open_connection(sock=sock)
except (ConnectionResetError, ConnectionRefusedError, ConnectionAbortedError, OSError, ValueError):
log.exception("Driver startup failed")
raise FbStartupError("Driver startup failed")

self.__task_recv = asyncio.create_task(self._loop_recv(reader))
Expand Down
4 changes: 2 additions & 2 deletions openfreebuds/driver/huawei/driver/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ async def _handle_raw_pkg(self, pkg):
pkg = HuaweiSppPackage.from_bytes(pkg)
log.debug(f"RX {pkg}")
except (AssertionError, OfbPackageChecksumError):
log.exception(f"Got non-parsable package {pkg.hex()}, ignoring")
log.info(f"Got non-parsable package {pkg.hex()}, ignoring")
return

if pkg.command_id in self.__pending_responses:
Expand Down Expand Up @@ -159,7 +159,7 @@ async def init(self):
async with asyncio.timeout(self.init_timeout):
await self.on_init()
break
except TimeoutError:
except (TimeoutError, ConnectionResetError):
self.init_attempt += 1
except Exception:
log.exception(f"Unknown error on {self.handler_id} init")
Expand Down
1 change: 0 additions & 1 deletion openfreebuds/shortcuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ async def execute(self, shortcut, *args, no_catch: bool = False):

return await handler(*args)
except Exception as e:
log.exception(f"While triggering shortcut {shortcut}")
if no_catch:
raise e

Expand Down

0 comments on commit 028548c

Please sign in to comment.