diff --git a/apps/chat/agent/openapi_tool.py b/apps/chat/agent/openapi_tool.py index f513afdb8..fc02e7a36 100644 --- a/apps/chat/agent/openapi_tool.py +++ b/apps/chat/agent/openapi_tool.py @@ -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)}")