Spaces:
Running
Running
chore(sync): mirror backend .py + Dockerfile to Space (hf-sync-backend)
Browse filesAutomated backend sync from szl-holdings/a11oy main via hf-sync-backend.
Updated (differed from the Space): corpus/formulas/a11oy__a11oy_v4_formulas.py
Deleted (gone from the repo + Dockerfile COPY set): (none)
Keeps the Space-built backend (serve.py + the Dockerfile-COPY'd .py
modules) identical to GitHub main so the Space never rebuilds from a
stale backend, new endpoints don't 404 there, and orphaned modules
removed from the repo don't linger in the Space tree.
corpus/formulas/a11oy__a11oy_v4_formulas.py
CHANGED
|
@@ -847,7 +847,10 @@ def register(app, ns: str = "a11oy", web_dir: Optional[str] = None) -> Dict[str,
|
|
| 847 |
try:
|
| 848 |
result = evaluate(name, opts or {}, config)
|
| 849 |
except GateError as ge:
|
| 850 |
-
|
|
|
|
|
|
|
|
|
|
| 851 |
code = result.get("code")
|
| 852 |
if code in (404, 422):
|
| 853 |
return JSONResponse(result, status_code=code)
|
|
|
|
| 847 |
try:
|
| 848 |
result = evaluate(name, opts or {}, config)
|
| 849 |
except GateError as ge:
|
| 850 |
+
# Honesty + CodeQL py/stack-trace-exposure: full exception text stays in
|
| 851 |
+
# server logs; the HTTP-visible field carries the exception class only.
|
| 852 |
+
print(f"[a11oy_v4] evaluate({name!r}) rejected: {type(ge).__name__}: {ge}", flush=True)
|
| 853 |
+
return JSONResponse({"ok": False, "error": type(ge).__name__, "code": 400, "slug": name}, status_code=400)
|
| 854 |
code = result.get("code")
|
| 855 |
if code in (404, 422):
|
| 856 |
return JSONResponse(result, status_code=code)
|