def test_log_stack_trace_for_core_exceptions(self):
        """Ensure stack trace is logged for core exceptions, e.g.,IndexExistsError"""
        raised_error = core_exceptions.IndexExistsError("index1")
        with patch('marqo.api.route.logger.error') as mock_logger_error:
            with patch("marqo.core.index_management.index_management.IndexManagement.create_index",
                       side_effect=raised_error):
                response = self.client.post("/indexes/" + self.structured_index.name, json={
                    "type": "structured",
                    "allFields": [{"name": "field1", "type": "text"}],
                    "tensorFields": [],
                })
            mock_logger_error.assert_called_once()
            self.assertIn("index1", str(mock_logger_error.call_args))
Ensure stack trace is logged for core exceptions, e.g.,IndexExistsError
tests/integ_tests/tensor_search/test_api.py