"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-08 20:15:13.611901
"""

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

class FallbackExecutor:
    """
    A class for executing functions with fallbacks in case of errors.
    
    This class is designed to handle situations where a primary function might fail,
    and it provides the ability to specify a fallback function that will be executed if
    the primary function fails. The fallback function can optionally carry the same arguments.
    """

    def __init__(self, func: Callable[..., Any], fallback_func: Optional[Callable[..., Any]] = None):
        """
        Initialize FallbackExecutor with primary and optional fallback functions.

        :param func: The main function to execute
        :param fallback_func: An alternative function to use if the main function fails
        """
        self.func = func
        self.fallback_func = fallback_func

    def __call__(self, *args, **kwargs) -> Any:
        try:
            return self.func(*args, **kwargs)
        except Exception as e:
            print(f"Error occurred: {e}")
            if self.fallback_func:
                try:
                    return self.fallback_func(*args, **kwargs)
                except Exception as fe:
                    print(f"Fallback function also failed with error: {fe}")
            else:
                raise

# Example usage
def add_numbers(a: int, b: int) -> int:
    """Add two numbers."""
    return a + b

def subtract_numbers(a: int, b: int) -> int:
    """Subtract one number from another."""
    return a - b

# Create fallback executor with both functions and their fallbacks
fallback_add = FallbackExecutor(add_numbers, fallback_func=subtract_numbers)
result1 = fallback_add(5, 3)  # Should return 8 (addition)

# Simulate error by providing incorrect arguments
try:
    result2 = fallback_add('a', 'b')  # This should trigger the fallback function
except Exception as e:
    print(f"Caught an exception: {e}")

```