catch screenshot error when taking the final screenshot (#256)

This commit is contained in:
Shuchang Zheng
2024-05-04 18:27:42 -04:00
committed by GitHub
parent e75b86c611
commit e8a46d2a1a

View File

@@ -767,12 +767,17 @@ class ForgeAgent:
artifact_type=ArtifactType.SCREENSHOT_FINAL, artifact_type=ArtifactType.SCREENSHOT_FINAL,
data=screenshot, data=screenshot,
) )
except TargetClosedError as e: except TargetClosedError:
LOG.warning( LOG.warning(
"Failed to take screenshot before sending task response, page is closed", "Failed to take screenshot before sending task response, page is closed",
task_id=task.task_id, task_id=task.task_id,
step_id=last_step.step_id, step_id=last_step.step_id,
error=e, )
except Exception:
LOG.exception(
"Failed to take screenshot before sending task response",
task_id=task.task_id,
step_id=last_step.step_id,
) )
if task.workflow_run_id: if task.workflow_run_id: