"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-06 13:45:16.865662
"""

```python
from typing import Callable, Any


class FallbackExecutor:
    """
    A class for executing a function with fallback handling.
    
    This class wraps another callable (the primary executor) and provides a way to handle errors by falling back
    to a secondary executor if the primary fails. If both executions fail, an error is raised.

    Args:
        primary_executor: The main function to execute.
        fallback_executor: The secondary function to attempt in case of failure.
    
    Raises:
        Exception: If both the primary and fallback executors raise errors.
    """
    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, **kwargs) -> Any:
        try:
            return self.primary_executor(*args, **kwargs)
        except Exception as e_primary:
            try:
                return self.fallback_executor(*args, **kwargs)
            except Exception as e_secondary:
                raise Exception("Both primary and fallback executors failed.") from e_secondary


# Example usage
def divide(a: float, b: float) -> float:
    """ Divide two numbers. """
    return a / b

def safe_divide(a: float, b: float) -> float:
    """ Safe division that catches zero division errors. """
    if b == 0:
        return 0.0
    return divide(a, b)

# Creating fallback_executor instance
fallback_executor = FallbackExecutor(divide, safe_divide)

# Example calls
try:
    result = fallback_executor.execute(10, 2)
    print(f"Result: {result}")
except Exception as e:
    print(e)
    
try:
    result = fallback_executor.execute(10, 0)  # This will trigger the fallback
    print(f"Result: {result}")
except Exception as e:
    print(e)

# Output should be:
# Result: 5.0
# Result: 0.0
```