public run endpoint with error code (#3512)
This commit is contained in:
@@ -1592,6 +1592,7 @@ class WorkflowService:
|
|||||||
totp_url=workflow_run.totp_verification_url or None,
|
totp_url=workflow_run.totp_verification_url or None,
|
||||||
totp_identifier=workflow_run.totp_identifier,
|
totp_identifier=workflow_run.totp_identifier,
|
||||||
),
|
),
|
||||||
|
errors=workflow_run_status_response.errors,
|
||||||
)
|
)
|
||||||
payload_dict = json.loads(workflow_run_status_response.model_dump_json())
|
payload_dict = json.loads(workflow_run_status_response.model_dump_json())
|
||||||
workflow_run_response_dict = json.loads(workflow_run_response.model_dump_json())
|
workflow_run_response_dict = json.loads(workflow_run_response.model_dump_json())
|
||||||
|
|||||||
@@ -427,6 +427,10 @@ class BaseRunResponse(BaseModel):
|
|||||||
default=None,
|
default=None,
|
||||||
description="The script run result",
|
description="The script run result",
|
||||||
)
|
)
|
||||||
|
errors: list[dict[str, Any]] | None = Field(
|
||||||
|
default=None,
|
||||||
|
description="The errors for the run",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class TaskRunResponse(BaseRunResponse):
|
class TaskRunResponse(BaseRunResponse):
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ async def get_run_response(run_id: str, organization_id: str | None = None) -> R
|
|||||||
error_code_mapping=task_v1_response.request.error_code_mapping,
|
error_code_mapping=task_v1_response.request.error_code_mapping,
|
||||||
max_screenshot_scrolls=task_v1_response.request.max_screenshot_scrolls,
|
max_screenshot_scrolls=task_v1_response.request.max_screenshot_scrolls,
|
||||||
),
|
),
|
||||||
|
errors=task_v1_response.errors,
|
||||||
)
|
)
|
||||||
elif run.task_run_type == RunType.task_v2:
|
elif run.task_run_type == RunType.task_v2:
|
||||||
task_v2 = await app.DATABASE.get_task_v2(run.run_id, organization_id=organization_id)
|
task_v2 = await app.DATABASE.get_task_v2(run.run_id, organization_id=organization_id)
|
||||||
|
|||||||
@@ -1711,6 +1711,7 @@ async def build_task_v2_run_response(task_v2: TaskV2) -> TaskRunResponse:
|
|||||||
data_extraction_schema=task_v2.extracted_information_schema,
|
data_extraction_schema=task_v2.extracted_information_schema,
|
||||||
error_code_mapping=task_v2.error_code_mapping,
|
error_code_mapping=task_v2.error_code_mapping,
|
||||||
),
|
),
|
||||||
|
errors=workflow_run_resp.errors if workflow_run_resp else None,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -138,4 +138,5 @@ async def get_workflow_run_response(
|
|||||||
browser_address=workflow_run.browser_address,
|
browser_address=workflow_run.browser_address,
|
||||||
# TODO: add browser session id
|
# TODO: add browser session id
|
||||||
),
|
),
|
||||||
|
errors=workflow_run_resp.errors,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user