判决接口:单票数据异常不崩整批,与代码形态错误的兜错对称

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
zlt 2026-09-02 11:48:26 +08:00
parent 5e015f680e
commit 386f28e8e5
1 changed files with 6 additions and 1 deletions

5
api.py
View File

@ -99,7 +99,12 @@ def plan_verdict(codes: str | None = None, code: str | None = None,
except SystemExit as e: # _norm_code 认不出的形态会 raise SystemExit except SystemExit as e: # _norm_code 认不出的形态会 raise SystemExit
verdicts.append({"input": c, "error": str(e)}) verdicts.append({"input": c, "error": str(e)})
continue continue
try:
v = plan_reconcile.verdict(k, L) v = plan_reconcile.verdict(k, L)
except Exception as e: # noqa: BLE001 —— 单票数据异常(如 score 缺行)不崩整批,
verdicts.append({"input": c, "code": k, # 与上面认不出形态的处理对称
"error": f"{type(e).__name__}: {e}"})
continue
v["input"] = c v["input"] = c
verdicts.append(v) verdicts.append(v)
return {"date": d, "stale": L.get("stale", ""), return {"date": d, "stale": L.get("stale", ""),