"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-05 23:22:23.584259
"""

```python
from typing import Callable


class FallbackExecutorException(Exception):
    """Custom exception for FallbackExecutor."""


class FallbackExecutor:
    """
    A class that provides a fallback mechanism to execute a function in case of an error.

    :param primary_func: The main function to be executed.
    :param fallback_func: The function to be used as a fallback, defaults to None
    """

    def __init__(self, primary_func: Callable, fallback_func: Callable = None):
        self.primary_func = primary_func
        self.fallback_func = fallback_func

    def execute(self, *args, **kwargs) -> str:
        """
        Execute the primary function with provided arguments. If an exception occurs,
        attempt to use the fallback function and return its result or raise if no fallback.

        :param args: Arguments for the primary function.
        :param kwargs: Keyword arguments for the primary function.
        :return: The result of the executed function.
        """
        try:
            return self.primary_func(*args, **kwargs)
        except Exception as e:
            print(f"Primary function failed with error: {e}")
            if self.fallback_func is None:
                raise FallbackExecutorException("No fallback function provided")
            else:
                return self.fallback_func(*args, **kwargs)


# Example usage
def safe_division(x: int, y: int) -> float:
    """Safe division of two numbers."""
    return x / y


def safe_subtraction(x: int, y: int) -> int:
    """Safe subtraction of two numbers (fallback)."""
    return abs(y - x)


if __name__ == "__main__":
    # Create an instance of FallbackExecutor
    executor = FallbackExecutor(safe_division, fallback_func=safe_subtraction)

    try:
        print(executor.execute(10, 2))  # Normal execution
    except FallbackExecutorException as e:
        print(f"Error: {e}")

    try:
        print(executor.execute(10, 0))  # Division by zero error
    except FallbackExecutorException as e:
        print(f"Error: {e}")
```