"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-07 14:38:25.902798
"""

```python
from typing import Callable, Any


class FallbackExecutor:
    """
    A class for executing a function with fallback execution in case of errors.
    
    :param func: The main function to execute.
    :type func: Callable[..., Any]
    :param fallback_func: The function to execute if an error occurs in the main function.
    :type fallback_func: Callable[..., Any]
    """
    
    def __init__(self, func: Callable[..., Any], fallback_func: Callable[..., Any]):
        self.func = func
        self.fallback_func = fallback_func
    
    def run(self, *args: Any, **kwargs: Any) -> Any:
        """
        Execute the main function with error recovery.
        
        :param args: Positional arguments to pass to the functions.
        :param kwargs: Keyword arguments to pass to the functions.
        :return: The result of the executed function or fallback function.
        :raises Exception: If both functions raise an exception.
        """
        try:
            return self.func(*args, **kwargs)
        except Exception as e1:
            try:
                return self.fallback_func(*args, **kwargs)
            except Exception as e2:
                raise Exception(f"Both main and fallback functions failed with errors: {e1}, {e2}") from e2


# 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 returns 0 if division by zero occurs."""
    try:
        return divide(a, b)
    except ZeroDivisionError:
        return 0.0


# Create instance of FallbackExecutor
executor = FallbackExecutor(divide, safe_divide)

# Test with valid input
result = executor.run(10.0, 2.0)  # Should return 5.0

# Test with invalid input (division by zero)
try:
    result = executor.run(10.0, 0.0)
except Exception as e:
    print(f"Caught an error: {e}")  # Should handle the ZeroDivisionError
```