Skip to content

Commit

Permalink
fix: use getattr on error if it's not a dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad-mtos committed Nov 4, 2024
1 parent 81dfdfa commit 6ed8d64
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion agents-api/agents_api/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
]

Expand Down

0 comments on commit 6ed8d64

Please sign in to comment.