mirror of
https://github.com/Skyvern-AI/skyvern.git
synced 2025-09-15 09:49:46 +00:00
remove exc_info from LOG.exception (#246)
This commit is contained in:
parent
45d11e5a7f
commit
b6a85cf3a5
8 changed files with 20 additions and 22 deletions
|
@ -302,7 +302,6 @@ class ForgeAgent:
|
|||
except FailedToSendWebhook:
|
||||
LOG.exception(
|
||||
"Failed to send webhook",
|
||||
exc_info=True,
|
||||
task_id=task.task_id,
|
||||
step_id=step.step_id,
|
||||
task=task,
|
||||
|
|
|
@ -41,7 +41,7 @@ class AsyncAWSClient:
|
|||
error_code = e.response["Error"]["Code"] # type: ignore
|
||||
except Exception:
|
||||
error_code = "failed-to-get-error-code"
|
||||
LOG.exception("Failed to get secret.", secret_name=secret_name, error_code=error_code, exc_info=True)
|
||||
LOG.exception("Failed to get secret.", secret_name=secret_name, error_code=error_code)
|
||||
return None
|
||||
|
||||
@execute_with_async_client(client_type=AWSClientType.S3)
|
||||
|
|
|
@ -165,10 +165,10 @@ class AgentDB:
|
|||
await session.refresh(new_artifact)
|
||||
return convert_to_artifact(new_artifact, self.debug_enabled)
|
||||
except SQLAlchemyError:
|
||||
LOG.exception("SQLAlchemyError", exc_info=True)
|
||||
LOG.exception("SQLAlchemyError")
|
||||
raise
|
||||
except Exception:
|
||||
LOG.exception("UnexpectedError", exc_info=True)
|
||||
LOG.exception("UnexpectedError")
|
||||
raise
|
||||
|
||||
async def get_task(self, task_id: str, organization_id: str | None = None) -> Task | None:
|
||||
|
@ -580,10 +580,10 @@ class AgentDB:
|
|||
else:
|
||||
return None
|
||||
except SQLAlchemyError:
|
||||
LOG.exception("SQLAlchemyError", exc_info=True)
|
||||
LOG.exception("SQLAlchemyError")
|
||||
raise
|
||||
except Exception:
|
||||
LOG.exception("UnexpectedError", exc_info=True)
|
||||
LOG.exception("UnexpectedError")
|
||||
raise
|
||||
|
||||
async def get_artifact(
|
||||
|
@ -662,10 +662,10 @@ class AgentDB:
|
|||
return artifacts[0]
|
||||
return None
|
||||
except SQLAlchemyError:
|
||||
LOG.exception("SQLAlchemyError", exc_info=True)
|
||||
LOG.exception("SQLAlchemyError")
|
||||
raise
|
||||
except Exception:
|
||||
LOG.exception("UnexpectedError", exc_info=True)
|
||||
LOG.exception("UnexpectedError")
|
||||
raise
|
||||
|
||||
async def get_latest_n_artifacts(
|
||||
|
@ -693,10 +693,10 @@ class AgentDB:
|
|||
return [convert_to_artifact(artifact, self.debug_enabled) for artifact in artifacts]
|
||||
return None
|
||||
except SQLAlchemyError:
|
||||
LOG.exception("SQLAlchemyError", exc_info=True)
|
||||
LOG.exception("SQLAlchemyError")
|
||||
raise
|
||||
except Exception:
|
||||
LOG.exception("UnexpectedError", exc_info=True)
|
||||
LOG.exception("UnexpectedError")
|
||||
raise
|
||||
|
||||
async def get_latest_task_by_workflow_id(
|
||||
|
|
|
@ -85,7 +85,6 @@ class Block(BaseModel, abc.ABC):
|
|||
except Exception:
|
||||
LOG.exception(
|
||||
"Block execution failed",
|
||||
exc_info=True,
|
||||
workflow_run_id=workflow_run_id,
|
||||
block_label=self.label,
|
||||
block_type=self.block_type,
|
||||
|
@ -657,7 +656,7 @@ class UploadToS3Block(Block):
|
|||
uri=self._get_s3_uri(workflow_run_id, self.path), file_path=self.path
|
||||
)
|
||||
except Exception as e:
|
||||
LOG.exception("UploadToS3Block: Failed to upload file to S3", file_path=self.path, exc_info=True)
|
||||
LOG.exception("UploadToS3Block: Failed to upload file to S3", file_path=self.path)
|
||||
raise e
|
||||
|
||||
LOG.info("UploadToS3Block: File(s) uploaded to S3", file_path=self.path)
|
||||
|
|
|
@ -192,7 +192,6 @@ class WorkflowService:
|
|||
LOG.exception(
|
||||
f"Error while executing workflow run {workflow_run.workflow_run_id}",
|
||||
workflow_run_id=workflow_run.workflow_run_id,
|
||||
exc_info=True,
|
||||
)
|
||||
await self.mark_workflow_run_as_failed(workflow_run_id=workflow_run.workflow_run_id)
|
||||
raise e
|
||||
|
|
|
@ -228,7 +228,9 @@ async def handle_download_file_action(
|
|||
await download.save_as(full_file_path)
|
||||
except Exception as e:
|
||||
LOG.exception(
|
||||
"DownloadFileAction: Failed to download file", action=action, full_file_path=full_file_path, exc_info=True
|
||||
"DownloadFileAction: Failed to download file",
|
||||
action=action,
|
||||
full_file_path=full_file_path,
|
||||
)
|
||||
return [ActionFailure(e)]
|
||||
|
||||
|
@ -363,7 +365,7 @@ async def handle_select_option_action(
|
|||
if action.option.index is not None:
|
||||
LOG.warning(
|
||||
"Failed to click on the option by label, trying by index",
|
||||
exc_info=e,
|
||||
exc_info=True,
|
||||
action=action,
|
||||
xpath=xpath,
|
||||
)
|
||||
|
@ -667,7 +669,7 @@ async def click_sibling_of_input(
|
|||
interacted_with_sibling=True,
|
||||
)
|
||||
except Exception as e:
|
||||
LOG.warning("Failed to click sibling label of input element", exc_info=e)
|
||||
LOG.warning("Failed to click sibling label of input element", exc_info=True)
|
||||
return ActionFailure(exception=e, javascript_triggered=javascript_triggered)
|
||||
|
||||
|
||||
|
|
|
@ -181,7 +181,7 @@ class BrowserState:
|
|||
await self.page.goto(url)
|
||||
await asyncio.sleep(3)
|
||||
except Error as playright_error:
|
||||
LOG.exception(f"Error while navigating to url: {str(playright_error)}", exc_info=True)
|
||||
LOG.exception(f"Error while navigating to url: {str(playright_error)}")
|
||||
raise FailedToNavigateToUrl(url=url, error_message=str(playright_error))
|
||||
success = True
|
||||
LOG.info(f"Successfully went to {url}")
|
||||
|
@ -190,13 +190,12 @@ class BrowserState:
|
|||
except Exception as e:
|
||||
LOG.exception(
|
||||
f"Error while creating or navigating to a new page. Waiting for 5 seconds. Error: {str(e)}",
|
||||
exc_info=True,
|
||||
)
|
||||
retries += 1
|
||||
# Wait for 5 seconds before retrying
|
||||
await asyncio.sleep(5)
|
||||
if retries >= 3:
|
||||
LOG.exception(f"Failed to create a new page after 3 retries: {str(e)}", exc_info=True)
|
||||
LOG.exception(f"Failed to create a new page after 3 retries: {str(e)}")
|
||||
raise e
|
||||
LOG.info(f"Retrying to create a new page. Retry count: {retries}")
|
||||
|
||||
|
@ -236,8 +235,8 @@ class BrowserState:
|
|||
animations="disabled",
|
||||
)
|
||||
except TimeoutError as e:
|
||||
LOG.exception(f"Timeout error while taking screenshot: {str(e)}", exc_info=True)
|
||||
LOG.exception(f"Timeout error while taking screenshot: {str(e)}")
|
||||
raise FailedToTakeScreenshot(error_message=str(e)) from e
|
||||
except Exception as e:
|
||||
LOG.exception(f"Unknown error while taking screenshot: {str(e)}", exc_info=True)
|
||||
LOG.exception(f"Unknown error while taking screenshot: {str(e)}")
|
||||
raise FailedToTakeScreenshot(error_message=str(e)) from e
|
||||
|
|
|
@ -49,7 +49,7 @@ def load_js_script() -> str:
|
|||
with open(path, "r") as f:
|
||||
return f.read()
|
||||
except FileNotFoundError as e:
|
||||
LOG.exception("Failed to load the JS script", exc_info=True, path=path)
|
||||
LOG.exception("Failed to load the JS script", path=path)
|
||||
raise e
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue