skip exception if pre block screenshot failed (#3652)
This commit is contained in:
@@ -344,13 +344,21 @@ class Block(BaseModel, abc.ABC):
|
|||||||
if not browser_state:
|
if not browser_state:
|
||||||
LOG.warning("No browser state found when creating workflow_run_block", workflow_run_id=workflow_run_id)
|
LOG.warning("No browser state found when creating workflow_run_block", workflow_run_id=workflow_run_id)
|
||||||
else:
|
else:
|
||||||
screenshot = await browser_state.take_fullpage_screenshot(
|
try:
|
||||||
use_playwright_fullpage=app.EXPERIMENTATION_PROVIDER.is_feature_enabled_cached(
|
screenshot = await browser_state.take_fullpage_screenshot(
|
||||||
"ENABLE_PLAYWRIGHT_FULLPAGE",
|
use_playwright_fullpage=app.EXPERIMENTATION_PROVIDER.is_feature_enabled_cached(
|
||||||
workflow_run_id,
|
"ENABLE_PLAYWRIGHT_FULLPAGE",
|
||||||
properties={"organization_id": str(organization_id)},
|
workflow_run_id,
|
||||||
|
properties={"organization_id": str(organization_id)},
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
except Exception:
|
||||||
|
LOG.warning(
|
||||||
|
"Failed to take screenshot before executing the block, ignoring the exception",
|
||||||
|
workflow_run_id=workflow_run_id,
|
||||||
|
workflow_run_block_id=workflow_run_block_id,
|
||||||
|
)
|
||||||
|
screenshot = None
|
||||||
if screenshot:
|
if screenshot:
|
||||||
await app.ARTIFACT_MANAGER.create_workflow_run_block_artifact(
|
await app.ARTIFACT_MANAGER.create_workflow_run_block_artifact(
|
||||||
workflow_run_block=workflow_run_block,
|
workflow_run_block=workflow_run_block,
|
||||||
|
|||||||
Reference in New Issue
Block a user