"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-06 16:36:44.667712
"""

```python
from typing import Callable, Any


class FallbackExecutor:
    """
    A class for executing functions with fallbacks in case of errors.
    
    Attributes:
        primary_func (Callable): The main function to be executed.
        fallback_func (Callable): The fallback function to execute if the primary function fails.
    """

    def __init__(self, primary_func: Callable[..., Any], fallback_func: Callable[..., Any]):
        """
        Initialize FallbackExecutor with a primary and a fallback function.

        Args:
            primary_func (Callable): The main function to attempt execution.
            fallback_func (Callable): The function to execute if the primary function fails.
        """
        self.primary_func = primary_func
        self.fallback_func = fallback_func

    def run(self) -> Any:
        """
        Execute the primary function, and fall back to the secondary function in case of errors.

        Returns:
            Any: The result of the executed function or the fallback function.
        
        Raises:
            Exception: If both functions fail.
        """
        try:
            return self.primary_func()
        except Exception as e:
            print(f"Primary function failed with error: {e}")
            try:
                return self.fallback_func()
            except Exception as fe:
                print(f"Fallback function also failed with error: {fe}")
                raise Exception("Both primary and fallback functions failed.") from fe


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

def safe_divide(a: int, b: int) -> float:
    """Safe division that returns 0 if the denominator is 0."""
    return a / (b or 1)


# Create an instance of FallbackExecutor
executor = FallbackExecutor(
    primary_func=lambda: divide_numbers(10, 0),
    fallback_func=lambda: safe_divide(10, 2)
)

result = executor.run()
print(f"Result: {result}")
```