Raise screenshot error earlier when page is closed (#1108)
This commit is contained in:
@@ -1,3 +1,23 @@
|
||||
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
||||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
||||
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)*
|
||||
|
||||
- [title: 'Workato'](#title-workato)
|
||||
- [Running a Skyvern Task in Workato](#running-a-skyvern-task-in-workato)
|
||||
- [Setup](#setup)
|
||||
- [Configure](#configure)
|
||||
- [Test](#test)
|
||||
- [Running a Skyvern Workflow in Workato](#running-a-skyvern-workflow-in-workato)
|
||||
- [Setup](#setup-1)
|
||||
- [Configure](#configure-1)
|
||||
- [Test](#test-1)
|
||||
- [Adding a Previously Ran Task or Workflow in Workato](#adding-a-previously-ran-task-or-workflow-in-workato)
|
||||
- [Setup](#setup-2)
|
||||
- [Configure](#configure-2)
|
||||
- [Test](#test-2)
|
||||
|
||||
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
||||
|
||||
---
|
||||
title: 'Workato'
|
||||
---
|
||||
|
||||
@@ -39,6 +39,8 @@ class SkyvernFrame:
|
||||
file_path: str | None = None,
|
||||
timeout: float = SettingsManager.get_settings().BROWSER_LOADING_TIMEOUT_MS,
|
||||
) -> bytes:
|
||||
if page.is_closed():
|
||||
raise FailedToTakeScreenshot(error_message="Page is closed")
|
||||
try:
|
||||
await page.wait_for_load_state(timeout=SettingsManager.get_settings().BROWSER_LOADING_TIMEOUT_MS)
|
||||
LOG.debug("Page is fully loaded, agent is about to take screenshots")
|
||||
|
||||
Reference in New Issue
Block a user