diff --git a/matter_server/server/device_controller.py b/matter_server/server/device_controller.py index 32555856..4b51754d 100644 --- a/matter_server/server/device_controller.py +++ b/matter_server/server/device_controller.py @@ -687,7 +687,7 @@ async def remove_node(self, node_id: int) -> None: except ChipStackError as err: LOGGER.warning( "Removing current fabric from device failed: %s", - str(err), + str(err) or err.__class__.__name__, # only log stacktrace if we have debug logging enabled exc_info=err if LOGGER.isEnabledFor(logging.DEBUG) else None, ) @@ -1102,7 +1102,7 @@ async def _setup_node(self, node_id: int) -> None: LOGGER.warning( "Unable to interview Node %s: %s", node_id, - str(err), + str(err) or err.__class__.__name__, # log full stack trace if debug logging is enabled exc_info=err if LOGGER.isEnabledFor(logging.DEBUG) else None, ) @@ -1116,7 +1116,7 @@ async def _setup_node(self, node_id: int) -> None: LOGGER.warning( "Unable to subscribe to Node %s: %s", node_id, - str(err), + str(err) or err.__class__.__name__, # log full stack trace if debug logging is enabled exc_info=err if LOGGER.isEnabledFor(logging.DEBUG) else None, )