This commit is contained in:
2026-03-08 03:43:40 +08:00
parent 47f6cebc77
commit 10c83a84bf
2 changed files with 13 additions and 6 deletions
+10 -3
View File
@@ -125,6 +125,13 @@ class GeometryVerificationService:
stdout, stderr = await process.communicate()
stdout_text = stdout.decode('utf-8') if stdout else ''
stderr_text = stderr.decode('utf-8') if stderr else ''
logger.debug(f"验证脚本 stdout: {stdout_text[:500]}")
if stderr_text:
logger.debug(f"验证脚本 stderr: {stderr_text[:500]}")
if process.returncode == 0:
# 尝试读取生成的报告文件(在 STP 文件目录下)
report_path = stp_dir / (stp_abs_path.stem + "_verification_report.json")
@@ -137,12 +144,12 @@ class GeometryVerificationService:
else:
# 解析 stdout 获取结果
logger.warning(f"验证报告文件不存在: {report_path}")
return self._parse_verification_output(stdout.decode('utf-8'))
return self._parse_verification_output(stdout_text)
else:
logger.error(f"验证脚本执行失败 (returncode={process.returncode}): {stderr.decode('utf-8')}")
logger.error(f"验证脚本执行失败 (returncode={process.returncode}): {stderr_text}")
return {
"status": "error",
"error": stderr.decode('utf-8'),
"error": stderr_text,
"timestamp": datetime.now().isoformat()
}