Merge branch 'feat/semantic-beliefs' into feat/extra-agentspeak-functionality
# Conflicts: # src/control_backend/agents/bdi/bdi_program_manager.py
This commit is contained in:
@@ -193,7 +193,16 @@ class BaseAgent(ABC):
|
||||
|
||||
:param coro: The coroutine to execute as a task.
|
||||
"""
|
||||
task = asyncio.create_task(coro)
|
||||
|
||||
async def try_coro(coro_: Coroutine):
|
||||
try:
|
||||
await coro_
|
||||
except asyncio.CancelledError:
|
||||
self.logger.debug("A behavior was canceled successfully: %s", coro_)
|
||||
except Exception:
|
||||
self.logger.warning("An exception occurred in a behavior.", exc_info=True)
|
||||
|
||||
task = asyncio.create_task(try_coro(coro))
|
||||
self._tasks.add(task)
|
||||
task.add_done_callback(self._tasks.discard)
|
||||
return task
|
||||
|
||||
Reference in New Issue
Block a user