MCPcopy Create free account
hub / github.com/SqueezeAILab/TinyAgent / custom_http_exception_handler

Function custom_http_exception_handler

run_tiny_agent_server.py:52–57  ·  view source on GitHub ↗

Custom error handling for logging the errors to the TinyAgent log file.

(request, exc)

Source from the content-addressed store, hash-verified

50
51@app.exception_handler(StarletteHTTPException)
52async def custom_http_exception_handler(request, exc):
53 """
54 Custom error handling for logging the errors to the TinyAgent log file.
55 """
56 log(f"HTTPException {exc.status_code}: {exc.detail}")
57 return PlainTextResponse(exc.detail, status_code=exc.status_code)
58
59
60@app.post("/generate")

Callers

nothing calls this directly

Calls 1

logFunction · 0.90

Tested by

no test coverage detected