add skyvern defined error code (#3366)

This commit is contained in:
LawyZheng
2025-09-05 11:21:52 +08:00
committed by GitHub
parent d2c71a9542
commit e1901e281b
3 changed files with 26 additions and 1 deletions

19
skyvern/errors/errors.py Normal file
View File

@@ -0,0 +1,19 @@
from pydantic import BaseModel
class SkyvernDefinedError(BaseModel):
error_code: str
reasoning: str
def __repr__(self) -> str:
return f"{self.reasoning}(error_code={self.error_code})"
class ReachMaxStepsError(SkyvernDefinedError):
error_code: str = "REACH_MAX_STEPS"
reasoning: str = "The agent has reached the maximum number of steps."
class ReachMaxRetriesError(SkyvernDefinedError):
error_code: str = "REACH_MAX_RETRIES"
reasoning: str = "The agent has reached the maximum number of retries. It might be an issue with the agent. Please reach out to the Skyvern team for support."