better totp failure reason and error code (#3472)
This commit is contained in:
@@ -695,6 +695,33 @@ class NoTOTPVerificationCodeFound(SkyvernHTTPException):
|
||||
super().__init__(msg)
|
||||
|
||||
|
||||
class FailedToGetTOTPVerificationCode(SkyvernException):
|
||||
reason: str | None = None
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
task_id: str | None = None,
|
||||
workflow_run_id: str | None = None,
|
||||
workflow_id: str | None = None,
|
||||
totp_verification_url: str | None = None,
|
||||
totp_identifier: str | None = None,
|
||||
reason: str | None = None,
|
||||
) -> None:
|
||||
self.reason = reason
|
||||
msg = "Failed to get TOTP verification code."
|
||||
if task_id:
|
||||
msg += f" task_id={task_id}"
|
||||
if workflow_run_id:
|
||||
msg += f" workflow_run_id={workflow_run_id}"
|
||||
if workflow_id:
|
||||
msg += f" workflow_id={workflow_id}"
|
||||
if totp_verification_url:
|
||||
msg += f" totp_verification_url={totp_verification_url}"
|
||||
if totp_identifier:
|
||||
msg += f" totp_identifier={totp_identifier}"
|
||||
super().__init__(f"Failed to get TOTP verification code. reason: {reason}")
|
||||
|
||||
|
||||
class SkyvernContextWindowExceededError(SkyvernException):
|
||||
def __init__(self) -> None:
|
||||
message = "Context window exceeded. Please contact support@skyvern.com for help."
|
||||
|
||||
Reference in New Issue
Block a user