More logs to show why a script fails (#3287)
This commit is contained in:
@@ -173,8 +173,8 @@ class SkyvernPage:
|
|||||||
|
|
||||||
return decorator
|
return decorator
|
||||||
|
|
||||||
async def goto(self, url: str) -> None:
|
async def goto(self, url: str, timeout: float = settings.BROWSER_LOADING_TIMEOUT_MS) -> None:
|
||||||
await self.page.goto(url)
|
await self.page.goto(url, timeout=timeout)
|
||||||
|
|
||||||
async def _create_action_before_execution(
|
async def _create_action_before_execution(
|
||||||
self,
|
self,
|
||||||
@@ -445,7 +445,8 @@ class SkyvernPage:
|
|||||||
@action_wrap(ActionType.VERIFICATION_CODE)
|
@action_wrap(ActionType.VERIFICATION_CODE)
|
||||||
async def verification_code(
|
async def verification_code(
|
||||||
self, xpath: str, intention: str | None = None, data: str | dict[str, Any] | None = None
|
self, xpath: str, intention: str | None = None, data: str | dict[str, Any] | None = None
|
||||||
) -> None: ...
|
) -> None:
|
||||||
|
return
|
||||||
|
|
||||||
@action_wrap(ActionType.SCROLL)
|
@action_wrap(ActionType.SCROLL)
|
||||||
async def scroll(
|
async def scroll(
|
||||||
|
|||||||
@@ -599,6 +599,7 @@ async def run_task(
|
|||||||
)
|
)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
LOG.exception("Failed to run task block. Falling back to AI run.")
|
||||||
await _fallback_to_ai_run(
|
await _fallback_to_ai_run(
|
||||||
cache_key=cache_key,
|
cache_key=cache_key,
|
||||||
prompt=prompt,
|
prompt=prompt,
|
||||||
@@ -656,6 +657,7 @@ async def download(
|
|||||||
)
|
)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
LOG.exception("Failed to run download block. Falling back to AI run.")
|
||||||
await _fallback_to_ai_run(
|
await _fallback_to_ai_run(
|
||||||
cache_key=cache_key,
|
cache_key=cache_key,
|
||||||
prompt=prompt,
|
prompt=prompt,
|
||||||
@@ -713,6 +715,7 @@ async def action(
|
|||||||
)
|
)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
LOG.exception("Failed to run action block. Falling back to AI run.")
|
||||||
await _fallback_to_ai_run(
|
await _fallback_to_ai_run(
|
||||||
cache_key=cache_key,
|
cache_key=cache_key,
|
||||||
prompt=prompt,
|
prompt=prompt,
|
||||||
@@ -769,6 +772,7 @@ async def login(
|
|||||||
)
|
)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
LOG.exception("Failed to run login block. Falling back to AI run.")
|
||||||
await _fallback_to_ai_run(
|
await _fallback_to_ai_run(
|
||||||
cache_key=cache_key,
|
cache_key=cache_key,
|
||||||
prompt=prompt,
|
prompt=prompt,
|
||||||
@@ -941,8 +945,7 @@ async def generate_text(
|
|||||||
)
|
)
|
||||||
new_text = json_response.get("answer", new_text)
|
new_text = json_response.get("answer", new_text)
|
||||||
except Exception:
|
except Exception:
|
||||||
# If anything goes wrong, fall back to the original text
|
LOG.exception("Failed to generate text for script")
|
||||||
pass
|
|
||||||
return new_text
|
return new_text
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user