"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-07 00:33:40.688171
"""

```python
from typing import Callable, Any


class FallbackExecutor:
    """
    A class for executing a function with fallback support in case of errors.

    :param func: The main function to execute.
    :type func: Callable
    :param fallback_func: The fallback function to use when the main function fails.
    :type fallback_func: Callable
    """

    def __init__(self, func: Callable[..., Any], fallback_func: Callable[..., Any]):
        self.func = func
        self.fallback_func = fallback_func

    def execute_with_fallback(self) -> Any:
        """
        Execute the main function and handle exceptions by falling back to the fallback function.

        :return: The result of the executed function or the fallback function.
        :rtype: Any
        """
        try:
            return self.func()
        except Exception as e:
            print(f"Error occurred in {self.func.__name__}: {e}")
            return self.fallback_func()


# Example usage

def divide(a, b):
    """Divide two numbers."""
    return a / b


def safe_divide(a, b):
    """Safe division that returns 'Infinity' on division by zero."""
    if b == 0:
        return float('inf')
    return a / b


fallback_executor = FallbackExecutor(
    func=divide,
    fallback_func=safe_divide
)

# Example error case: divide by zero
result = fallback_executor.execute_with_fallback(10, 0)
print(result)  # Should print 'Infinity'

# Example normal case
result = fallback_executor.execute_with_fallback(10, 2)
print(result)  # Should print '5.0'
```