From f018297ad93f353a38b89eac4304eae53dc59779 Mon Sep 17 00:00:00 2001 From: langxm Date: Wed, 14 Oct 2026 10:31:11 +0800 Subject: [PATCH] =?UTF-8?q?debug(M7.2c):=20judge=20fetch=20=E5=8A=A0?= =?UTF-8?q?=E9=98=B2=E5=BE=A1=E6=97=A5=E5=BF=97=E5=AE=9A=E4=BD=8D=20PENDIN?= =?UTF-8?q?G=20=E6=9C=9F=E9=97=B4=20500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/api/routes/judge.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/backend/app/api/routes/judge.py b/backend/app/api/routes/judge.py index bebedc9..d36b40a 100644 --- a/backend/app/api/routes/judge.py +++ b/backend/app/api/routes/judge.py @@ -64,6 +64,15 @@ async def fetch(rid: str, uid: str = "guest", session: Session = Depends(get_ses data = await svc.fetch(rid) except JudgeEngineError as e: raise HTTPException(404, str(e)) + except Exception as e: + import logging, traceback + logging.getLogger("fluent.judge").exception("judge fetch 未预期异常") + try: + with open("/tmp/fl_judge_err.log", "a") as f: + f.write(f"[{rid}] {type(e).__name__}: {e}\n{traceback.format_exc()}\n---\n") + except Exception: + pass + raise HTTPException(500, f"judge fetch 内部错误: {type(e).__name__}: {e}") # 判题结果回写消息 meta msg = MessageRepo(session).find_by_meta("rid", rid) if msg: