"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-07 16:18:41.770033
"""

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

class FallbackExecutor:
    """
    A class to handle execution of tasks with a fallback mechanism in case of errors.
    
    Parameters:
        - primary_exec: Callable function representing the main task to be executed.
        - fallback_exec: Callable function representing the secondary task to recover from errors.
        
    Methods:
        execute(task_data): Executes the task using primary_exec and handles exceptions by trying fallback_exec if needed.
    """
    
    def __init__(self, primary_exec: Callable[..., Any], fallback_exec: Optional[Callable[..., Any]] = None):
        self.primary_exec = primary_exec
        self.fallback_exec = fallback_exec
    
    def execute(self, task_data: Any) -> Any:
        try:
            return self.primary_exec(task_data)
        except Exception as e:
            if self.fallback_exec is not None:
                print(f"Primary execution failed with error: {e}")
                return self.fallback_exec(task_data)
            else:
                raise RuntimeError("No fallback executor provided and primary exec failed") from e

# Example usage
def main_task(data):
    """
    A sample task that might fail.
    
    Parameters:
        - data: Any data to be processed by the function.
        
    Returns:
        str: Result of processing or an error message if it fails.
    """
    import random
    if random.random() < 0.3:
        raise ValueError("Simulated failure")
    return f"Processed {data}"

def fallback_task(data):
    """
    A sample fallback task that tries a different approach to process the data.
    
    Parameters:
        - data: Any data to be processed by the function.
        
    Returns:
        str: Result of processing or an error message if it fails.
    """
    return f"Fallback processed {data}"

# Create an instance with both primary and fallback executors
executor = FallbackExecutor(primary_exec=main_task, fallback_exec=fallback_task)

# Execute tasks
try_data_1 = "example 1"
result = executor.execute(try_data_1)
print(result)  # Expected: Processed example 1 or Fallback processed example 1

try_data_2 = "example 2"
result = executor.execute(try_data_2)
print(result)  # Expected: Processed example 2 (with no exception) if main_task succeeds, otherwise Fallback processed example 2
```