Skip to content

Commit

Permalink
fix(agents-api): Fix handling error message type
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad-mtos committed Nov 4, 2024
1 parent 0aa4aeb commit 714b9f4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion agents-api/agents_api/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ async def _handler(request: Request, exc: Exception):
offending_input = offending_input[loc]

# Keep only the message from the error
errors = [error.get("msg", error) for error in errors]
errors = [
error.get("msg", error) if hasattr(error, "msg") else error
for error in errors
]

else:
errors = exc.errors() if hasattr(exc, "errors") else [exc]
Expand Down

0 comments on commit 714b9f4

Please sign in to comment.