diff --git a/agents-api/agents_api/web.py b/agents-api/agents_api/web.py index 7b4ee114..c6e5fc15 100644 --- a/agents-api/agents_api/web.py +++ b/agents-api/agents_api/web.py @@ -100,7 +100,7 @@ async def _handler(request: Request, exc: Exception): # Keep only the message from the error errors = [ - error.get("msg", error) if hasattr(error, "msg") else error + error.get("msg", error) if isinstance(error, dict) else getattr(error, "msg", error) for error in errors ]