Skip to content

Commit

Permalink
Merge pull request #1010 from dimagi/cs/update_error
Browse files Browse the repository at this point in the history
Give the bot info about what went wrong
  • Loading branch information
SmittieC authored Dec 19, 2024
2 parents 26b7141 + 8e9aa0c commit 4b40a94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/chat/agent/openapi_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ def call_api(self, **kwargs) -> Any:
try:
return self.auth_service.call_with_retries(self._make_request, client, url, method, **kwargs)
except httpx.HTTPStatusError as e:
# if e.response and e.response.status_code == 400:
# return {"error": "Bad Request", "details": e.response.text}
if e.response and e.response.status_code == 400:
raise ToolException(f"Bad request: {e.response.text}")
raise ToolException(f"Error making request: {str(e)}")
except httpx.HTTPError as e:
raise ToolException(f"Error making request: {str(e)}")
Expand Down

0 comments on commit 4b40a94

Please sign in to comment.