让免费层限流的报告跟真实限流一致,并给少一块结果的静默失败留下函数名和错误类型。

Co-Authored-By: Grok (agent loop)
This commit is contained in:
jesse-ux
2026-10-15 23:12:56 +08:00
co-authored by Grok (agent loop)
parent e4ff62c738
commit a7162db271
38 changed files with 706 additions and 129 deletions
+3 -3
View File
@@ -683,7 +683,7 @@ def _compiled_exec_code(expr):
tree.body = _capture_tail_expr(tree.body)
ast.fix_missing_locations(tree)
return compile(tree, "<yoga_custom>", "exec")
except Exception:
except Exception: # noqa: BLE001 - a custom rule expression is expected to fail; that rule is skipped
return None
@@ -700,7 +700,7 @@ def _run_custom_expr(expr, exec_globals):
result = eval(code, exec_globals, exec_globals)
except SyntaxError:
code = None # 运行期 SyntaxError:与改前一样退到多语句分支
except Exception:
except Exception: # noqa: BLE001 - a custom rule expression is expected to fail; that rule is skipped
return None
if code is None:
exec_code = _compiled_exec_code(expr)
@@ -708,7 +708,7 @@ def _run_custom_expr(expr, exec_globals):
try:
exec(exec_code, exec_globals, exec_globals)
result = exec_globals.get("__result__")
except Exception:
except Exception: # noqa: BLE001 - a custom rule expression is expected to fail; that rule is skipped
return None
return result