mirror of
https://github.com/microsoft/autogen.git
synced 2025-11-16 10:04:36 +00:00
Dont print exceptions for cancelled errors (#119)
This commit is contained in:
parent
a73a0330e5
commit
bb4bb5bd14
@ -2,7 +2,7 @@ import asyncio
|
|||||||
import inspect
|
import inspect
|
||||||
import logging
|
import logging
|
||||||
import threading
|
import threading
|
||||||
from asyncio import Future
|
from asyncio import CancelledError, Future
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from collections.abc import Sequence
|
from collections.abc import Sequence
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
@ -281,10 +281,12 @@ class SingleThreadedAgentRuntime(AgentRuntime):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
_all_responses = await asyncio.gather(*responses)
|
_all_responses = await asyncio.gather(*responses)
|
||||||
except BaseException:
|
except BaseException as e:
|
||||||
logger.error("Error processing publish message", exc_info=True)
|
# Ignore cancelled errors from logs
|
||||||
|
if isinstance(e, CancelledError):
|
||||||
return
|
return
|
||||||
|
logger.error("Error processing publish message", exc_info=True)
|
||||||
|
finally:
|
||||||
self._outstanding_tasks.decrement()
|
self._outstanding_tasks.decrement()
|
||||||
# TODO if responses are given for a publish
|
# TODO if responses are given for a publish
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user