async def test_run_async_exception_handling(
      self, credentials_config, mock_tool_context
  ):
    """Test that exceptions in tool execution are properly handled.

    Tools should gracefully handle errors and return structured
    error responses rather than letting exceptions propagate.
    """

    def failing_function(param1: str, credentials: Credentials = None) -> dict:
      raise ValueError("Something went wrong")

    tool = BigQueryTool(
        func=failing_function, credentials_config=credentials_config
    )

    mock_creds = Mock(spec=Credentials)
    with patch.object(
        tool._credentials_manager,
        "get_valid_credentials",
        return_value=mock_creds,
    ):

      result = await tool.run_async(
          args={"param1": "test_value"}, tool_context=mock_tool_context
      )

      assert result["status"] == "ERROR"
      assert "Something went wrong" in result["error_details"]
Test that exceptions in tool execution are properly handled.

    Tools should gracefully handle errors and return structured
    error responses rather than letting exceptions propagate.
    
tests/unittests/tools/bigquery/test_bigquery_tool.py