diff --git a/asyncua/client/client.py b/asyncua/client/client.py index 3e7ccb750..e8cf1d664 100644 --- a/asyncua/client/client.py +++ b/asyncua/client/client.py @@ -72,7 +72,7 @@ def __init__(self, url: str, timeout: float = 4, watchdog_intervall: float = 1.0 self.secure_channel_id = None self.secure_channel_timeout = 3600000 # 1 hour self.session_timeout = 3600000 # 1 hour - self.connection_lost_callback: Optional[Callable[[Exception], None]] = None + self.connection_lost_callback: Optional[Callable[[Exception], Coroutine[Any, Any, None]]] = None self._policy_ids: List[ua.UserTokenPolicy] = [] self.uaclient: UaClient = UaClient(timeout) self.uaclient.pre_request_hook = self.check_connection @@ -561,7 +561,7 @@ async def _monitor_server_loop(self): await self.uaclient.inform_subscriptions(ua.StatusCode(ua.StatusCodes.BadShutdown)) raise - async def _lost_connection(self, ex: BaseException): + async def _lost_connection(self, ex: Exception): if not self.connection_lost_callback: return try: