diff --git a/fastagency/app.py b/fastagency/app.py index bbac55e0d..9c88d6ad7 100644 --- a/fastagency/app.py +++ b/fastagency/app.py @@ -46,7 +46,7 @@ async def handle_keynotfounderror_middleware( try: return await call_next(request) except KeyNotFoundError as e: - return JSONResponse(status_code=404, content={"detail": str(e)}) + return JSONResponse(status_code=404, content={"detail": e.args[0]}) @app.get("/models/schemas")