Report error and stack trace for any uncaught exceptions in task queue

This commit is contained in:
Dominik Jain authored and Dominik Jain committed 2025-10-30 00:32:00 +01:00
1 parent 2d8a226d40
commit 6ce7d73130
1 file changed
+5 -2
+5 -2
View File
@@ -378,8 +378,11 @@ class SerenaAgent:
self._task_executor_task_index += 1
def task_execution_wrapper() -> Any:
with LogTime(task_name, logger=log):
return task()
try:
with LogTime(task_name, logger=log):
return task()
except Exception as e:
log.error(f"Error during execution of {task_name}: {e}", exc_info=e)
log.info(f"Scheduling {task_name}")
return self._task_executor.submit(task_execution_wrapper)