This commit is contained in:
2026-07-24 16:12:48 +08:00
2 changed files with 22 additions and 2 deletions
@@ -381,6 +381,16 @@ async def _soft_delete_steps_from_index(
def _step_to_out(step: ModuleGenerationStep) -> ShotReplicateStepOut:
error_message = step.error_message
if error_message:
from app.services.error_codes import ARK_ERRORS
import re
# 兼容两种格式: code='xxx' 或 'code': 'xxx'
match = re.search(r"""code['"]?\s*[:=]\s*['"]([^'"]+)['"]""", error_message)
if match:
code = match.group(1)
if code in ARK_ERRORS:
error_message = ARK_ERRORS[code]
return ShotReplicateStepOut(
id=step.id,
project_id=step.project_id,
@@ -395,7 +405,7 @@ def _step_to_out(step: ModuleGenerationStep) -> ShotReplicateStepOut:
chat_task_id=step.chat_task_id,
input=_parse_json(step.input_json, {}),
output=_parse_json(step.output_json, {}),
error_message=step.error_message,
error_message=error_message,
created_at=step.created_at,
updated_at=step.updated_at,
completed_at=step.completed_at,