"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-08 12:27:02.120127
"""

```python
from typing import Callable, Any


class FallbackExecutor:
    """
    A class that provides a mechanism for executing tasks with fallbacks in case of errors.
    
    Parameters:
        primary_executor (Callable): The main function to execute.
        fallback_executor (Callable): The function to execute if the primary executor fails.
    
    Usage example:
        >>> def primary_task(x: int) -> int:
        ...     return x + 10
        ...
        >>> def fallback_task(x: int) -> str:
        ...     return f"Failed for {x}"
        ...
        >>> fallback_executor = FallbackExecutor(primary_task, fallback_task)
        >>> result = fallback_executor.execute(5)
        '15'
    """

    def __init__(self, primary_executor: Callable[..., Any], fallback_executor: Callable[..., Any]):
        self.primary_executor = primary_executor
        self.fallback_executor = fallback_executor

    def execute(self, *args: Any, **kwargs: Any) -> Any:
        """
        Attempts to execute the primary executor function.
        
        If an exception occurs during execution, it catches the error and calls the fallback executor instead.
        
        Args:
            *args: Positional arguments passed to both executors.
            **kwargs: Keyword arguments passed to both executors.
        
        Returns:
            The result of the successful executor or its fallback if necessary.
        """
        try:
            return self.primary_executor(*args, **kwargs)
        except Exception as e:
            print(f"Primary task failed with error: {e}")
            return self.fallback_executor(*args, **kwargs)


# Example usage
def primary_task(x: int) -> int:
    return x + 10


def fallback_task(x: int) -> str:
    return f"Failed for {x}"


fallback_executor = FallbackExecutor(primary_task, fallback_task)
result = fallback_executor.execute(5)

print(result)  # Expected output: 15
```