Skip to content

Commit

Permalink
catch screenshot error when taking the final screenshot (#256)
Browse files Browse the repository at this point in the history
  • Loading branch information
wintonzheng authored May 4, 2024
1 parent e75b86c commit e8a46d2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions skyvern/forge/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -767,12 +767,17 @@ async def send_task_response(
artifact_type=ArtifactType.SCREENSHOT_FINAL,
data=screenshot,
)
except TargetClosedError as e:
except TargetClosedError:
LOG.warning(
"Failed to take screenshot before sending task response, page is closed",
task_id=task.task_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:
Expand Down

0 comments on commit e8a46d2

Please sign in to comment.