"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-08 11:04:11.662189
"""

```python
from typing import Callable, Any, Optional


class FallbackExecutor:
    """
    A class that provides a mechanism for executing tasks with fallback support.
    If the primary executor fails, it attempts to execute the backup function.

    :param primary: The primary callable object to attempt execution first.
    :param backup: An optional backup callable object to try if the primary fails.
    """

    def __init__(self, primary: Callable[..., Any], backup: Optional[Callable[..., Any]] = None):
        self.primary = primary
        self.backup = backup

    def execute(self, *args: Any, **kwargs: Any) -> Any:
        """
        Attempts to execute the primary callable. If it fails (raises an exception),
        it attempts to execute the backup callable if provided.

        :param args: Arguments to pass to the primary and fallback functions.
        :param kwargs: Keyword arguments to pass to the primary and fallback functions.
        :return: The result of the successfully executed function, or raises its exception.
        """
        try:
            return self.primary(*args, **kwargs)
        except Exception as e:
            if self.backup is not None:
                print(f"Primary execution failed with error: {e}")
                backup_result = self.backup(*args, **kwargs)
                print("Executing backup function.")
                return backup_result
            else:
                raise


# Example usage
def primary_task():
    # Simulating a task that may fail
    import random

    if random.random() < 0.5:
        return "Primary Task Success"
    else:
        raise ValueError("Simulated Failure")

def backup_task(*args, **kwargs):
    return f"Backup Task Success: {kwargs.get('extra_info', 'No extra info')}"

executor = FallbackExecutor(primary_task, backup_task)
result = executor.execute(extra_info="Example")
print(result)
```