"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-08 06:51:24.816720
"""

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


class FallbackExecutor:
    """
    A class for executing a function with fallbacks in case of errors.
    
    Parameters:
        - primary_func: The main function to execute (Callable)
        - fallback_funcs: A dictionary containing the error type as key and the fallback function as value (Dict[str, Callable])
        
    Methods:
        - execute: Executes the primary function and handles errors using the fallbacks if applicable
    """
    
    def __init__(self, primary_func: Callable[..., Any], fallback_funcs: Dict[str, Callable[..., Any]]):
        self.primary_func = primary_func
        self.fallback_funcs = fallback_funcs
    
    def _handle_error(self, error_type: str) -> Callable:
        return self.fallback_funcs.get(error_type, lambda *args, **kwargs: f"Unknown error: {error_type}")
    
    def execute(self, *args, **kwargs) -> Any:
        """
        Executes the primary function or a fallback based on the type of exception raised.
        
        Parameters:
            - *args: Arguments to pass to the functions
            - **kwargs: Keyword arguments to pass to the functions
        
        Returns:
            The result of the executed function or a fallback if an error occurs.
        """
        try:
            return self.primary_func(*args, **kwargs)
        except Exception as e:
            error_type = type(e).__name__
            print(f"An {error_type} occurred: {e}")
            fallback = self._handle_error(error_type)
            return fallback(*args, **kwargs)


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


def safe_divide(a: int, b: int) -> float:
    """Fallback function for division by zero."""
    print("Caught division by zero. Returning 0.")
    return 0.0


fallback_executor = FallbackExecutor(
    primary_func=divide,
    fallback_funcs={
        "ZeroDivisionError": safe_divide
    }
)

# Test cases
print(f"10 / 2: {fallback_executor.execute(10, 2)}")  # Normal case
print(f"10 / 0: {fallback_executor.execute(10, 0)}")  # Division by zero with fallback
```