Remove exception too general

This commit is contained in:
atse 2024-07-04 17:30:28 +08:00
parent 0791f0df4b
commit d29fae0476

View File

@ -12,7 +12,10 @@ class WrappedClient(QObject, Client):
async def _read_line(self):
try:
return await super()._read_line()
except (Exception, TimeoutError, asyncio.exceptions.TimeoutError):
except (
TimeoutError,
asyncio.TimeoutError, # Remove in Python 3.11
):
self.connection_error.emit()
@ -43,9 +46,8 @@ class Thermostat(QObject, metaclass=PropertyMeta):
try:
raise self.task.exception()
except (
Exception,
TimeoutError,
asyncio.exceptions.TimeoutError,
asyncio.TimeoutError, # Remove in Python 3.11
):
logging.error(
"Encountered an error while updating parameter tree.",