Commit e5fe2df0 authored by Christoph Ziebuhr's avatar Christoph Ziebuhr Committed by oroulet

Don't treat expected exceptions as error in close_session

Exceptions have already been handled and logged in _monitor_server_loop / _renew_channel_loop,
there is no need to log it again with higher loglevel
parent 30af6406
...@@ -641,20 +641,16 @@ class Client: ...@@ -641,20 +641,16 @@ class Client:
self._monitor_server_task.cancel() self._monitor_server_task.cancel()
try: try:
await self._monitor_server_task await self._monitor_server_task
except asyncio.CancelledError: except (asyncio.CancelledError, Exception):
pass pass
except Exception:
_logger.exception("Error while closing watch_task")
# disable hook because we kill our monitor task, so we are going to get CancelledError at every request # disable hook because we kill our monitor task, so we are going to get CancelledError at every request
self.uaclient.pre_request_hook = None self.uaclient.pre_request_hook = None
if self._renew_channel_task: if self._renew_channel_task:
self._renew_channel_task.cancel() self._renew_channel_task.cancel()
try: try:
await self._renew_channel_task await self._renew_channel_task
except asyncio.CancelledError: except (asyncio.CancelledError, Exception):
pass pass
except Exception:
_logger.exception("Error while closing secure channel loop")
return await self.uaclient.close_session(True) return await self.uaclient.close_session(True)
def get_root_node(self): def get_root_node(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment