Bläddra i källkod

fix: raise http request node error on httpx.request error (#11954)

Signed-off-by: -LAN- <laipz8200@outlook.com>
tags/0.14.2
-LAN- 10 månader sedan
förälder
incheckning
2c4df108e5
Inget konto är kopplat till bidragsgivarens mejladress

+ 7
- 1
api/core/ops/ops_trace_manager.py Visa fil

def conversation_trace(self, **kwargs): def conversation_trace(self, **kwargs):
return kwargs return kwargs


def workflow_trace(self, workflow_run: WorkflowRun, conversation_id, user_id):
def workflow_trace(self, workflow_run: WorkflowRun | None, conversation_id, user_id):
if not workflow_run:
raise ValueError("Workflow run not found")

db.session.merge(workflow_run)
db.sessoin.refresh(workflow_run)

workflow_id = workflow_run.workflow_id workflow_id = workflow_run.workflow_id
tenant_id = workflow_run.tenant_id tenant_id = workflow_run.tenant_id
workflow_run_id = workflow_run.id workflow_run_id = workflow_run.id

+ 2
- 0
api/core/workflow/nodes/http_request/executor.py Visa fil

# request_args = {k: v for k, v in request_args.items() if v is not None} # request_args = {k: v for k, v in request_args.items() if v is not None}
try: try:
response = getattr(ssrf_proxy, self.method)(**request_args) response = getattr(ssrf_proxy, self.method)(**request_args)
except httpx.RequestError as e:
raise HttpRequestNodeError(str(e))
except ssrf_proxy.MaxRetriesExceededError as e: except ssrf_proxy.MaxRetriesExceededError as e:
raise HttpRequestNodeError(str(e)) raise HttpRequestNodeError(str(e))
return response return response

Laddar…
Avbryt
Spara