diff --git a/pytec/pytec/gui/model/thermostat.py b/pytec/pytec/gui/model/thermostat.py index 5d2292f..6d511fc 100644 --- a/pytec/pytec/gui/model/thermostat.py +++ b/pytec/pytec/gui/model/thermostat.py @@ -40,19 +40,17 @@ class Thermostat(QObject, metaclass=PropertyMeta): self.task = asyncio.create_task(self.update_params()) while True: if self.task.done(): - if self.task.exception() is not None: - try: - raise self.task.exception() - except ( - Exception, - TimeoutError, - asyncio.exceptions.TimeoutError, - ): - logging.error( - "Encountered an error while updating parameter tree.", - exc_info=True, - ) - _ = self.task.result() + try: + _ = self.task.result() + except ( + Exception, + TimeoutError, + asyncio.exceptions.TimeoutError, + ): + logging.error( + "Encountered an error while updating parameter tree.", + exc_info=True, + ) self.task = asyncio.create_task(self.update_params()) await asyncio.sleep(self._update_s)