"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-07 06:27:58.056957
"""

```python
class FallbackExecutor:
    """
    A class for executing a primary function and handling errors by attempting a fallback function.
    
    Args:
        primary_function (Callable): The main function to be executed.
        fallback_function (Callable): The alternative function to be used if the primary function fails.
        error_types (Tuple[type, ...]): Tuple of exception types that should trigger the fallback function.

    Raises:
        Any: Exceptions raised by `primary_function` or `fallback_function`.

    Returns:
        Any: Result of the executed function.
    """

    def __init__(self, primary_function: Callable[..., Any], fallback_function: Callable[..., Any],
                 error_types: Tuple[type[BaseException], ...] = (Exception,)):
        self.primary_function = primary_function
        self.fallback_function = fallback_function
        self.error_types = error_types

    def execute(self) -> Any:
        try:
            return self.primary_function()
        except self.error_types as e:
            print(f"Error occurred: {e}. Fallback is executing.")
            return self.fallback_function()

# Example usage
def primary_data_fetch() -> str:
    """Simulate a function that may fail due to network issues."""
    import random

    if random.random() < 0.5:
        raise ConnectionError("Failed to connect")
    return "Primary data fetched successfully"

def fallback_data_fetch() -> str:
    """Fallback function in case primary_data_fetch fails."""
    return "Fallback data used."

executor = FallbackExecutor(primary_function=primary_data_fetch, fallback_function=fallback_data_fetch)

# Execute the executor
result = executor.execute()
print(result)
```