"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-08 16:14:39.212995
"""

```python
class FallbackExecutor:
    """
    A class for executing a task with fallback options in case of errors.

    :param primary_function: Callable function to be executed primarily.
    :param fallback_functions: List of callables that will be tried if the primary function fails.
    :param exception_types: Optional; Tuple of exception types to catch. Default is (Exception,)
    """

    def __init__(self, primary_function: callable, fallback_functions: list[callable], exception_types=(Exception,)):
        self.primary_function = primary_function
        self.fallback_functions = fallback_functions
        self.exception_types = exception_types

    def execute(self):
        """
        Execute the primary function. If it raises an exception of type in self.exception_types,
        try each fallback function until one succeeds or all are exhausted.
        """
        result = None
        for func in [self.primary_function] + self.fallback_functions:
            try:
                result = func()
                break  # Exit loop if no exceptions and a successful execution
            except self.exception_types as e:
                print(f"Executing {func.__name__} failed with: {e}")
        
        return result


# Example usage

def primary_task():
    """Primary task that might fail."""
    raise ValueError("This is an intentional error for demonstration purposes")

def fallback_1():
    """Fallback function 1."""
    return "Falling back to 1"

def fallback_2():
    """Fallback function 2."""
    return "Falling back to 2"

# Create a FallbackExecutor instance
executor = FallbackExecutor(primary_task, [fallback_1, fallback_2])

try:
    result = executor.execute()
    print(f"Primary task succeeded with: {result}")
except Exception as e:
    print(f"All tasks failed with the same exception: {e}")

```