Improve errors

This commit is contained in:
Simon Alibert 2025-03-24 21:13:26 +01:00
parent 0c1d4cb323
commit 7a75bb9f61
3 changed files with 4 additions and 7 deletions

View File

@ -148,8 +148,7 @@ class DynamixelMotorsBus(MotorsBus):
if not self._is_comm_success(comm):
if raise_on_error:
logger.error(self.packet_handler.getRxPacketError(comm))
raise ConnectionError
raise ConnectionError(self.packet_handler.getRxPacketError(comm))
return data_list if data_list else None

View File

@ -203,7 +203,7 @@ class FeetechMotorsBus(MotorsBus):
if not self._is_comm_success(comm):
if raise_on_error:
raise ConnectionError
raise ConnectionError(self.packet_handler.getRxPacketError(comm))
return ids_status if ids_status else None

View File

@ -451,14 +451,12 @@ class MotorsBus(abc.ABC):
if not self._is_comm_success(comm):
if raise_on_error:
logger.error(self.packet_handler.getRxPacketError(comm))
raise ConnectionError
raise ConnectionError(self.packet_handler.getRxPacketError(comm))
else:
return
if self._is_error(error):
if raise_on_error:
logger.error(self.packet_handler.getTxRxResult(comm))
raise ConnectionError
raise RuntimeError(self.packet_handler.getTxRxResult(comm))
else:
return