def test_error_handling(self, mock_get):
        """Tests error handling for API requests."""
        # Set up mock error response
        mock_response = Mock()
        mock_response.status_code = 401
        mock_response.ok = False
        mock_response.reason = "Unauthorized"
        mock_response.raise_for_status.side_effect = requests.exceptions.HTTPError(
            response=mock_response
        )
        mock_get.return_value = mock_response

        # Verify error handling
        import pytest

        with pytest.raises(Exception) as context:
            self.client.get_space(self.space_id)

        error_message = str(context.value)
        assert "Error" in error_message
        assert "401" in error_message
        assert "Unauthorized" in error_message
Tests error handling for API requests.
llama-index-integrations/readers/llama-index-readers-gitbook/tests/test_gitbook_client.py