"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-08 08:42:22.541891
"""

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


class FallbackExecutor:
    """
    A class that provides a fallback mechanism for executing functions.
    If an exception occurs during the execution of the primary function,
    it attempts to execute the fallback function.

    :param func: The primary function to be executed with arguments and keyword arguments
    :param fallback_func: The secondary (fallback) function to be executed if the primary fails
    """

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

    def execute(self, *args, **kwargs):
        """
        Execute the primary function. If an exception occurs,
        attempt to execute the fallback function.

        :param args: Positional arguments for the function
        :param kwargs: Keyword arguments for the function
        :return: The result of the executed function or None if both functions failed
        """
        try:
            return self.func(*args, **kwargs)
        except Exception as e:
            print(f"Primary function execution failed with error: {e}")
            try:
                return self.fallback_func(*args, **kwargs)
            except Exception as fe:
                print(f"Fallback function also failed with error: {fe}")
                return None


# Example usage
def primary_function(x: int) -> Union[int, str]:
    """
    A sample primary function that may fail under certain conditions.

    :param x: An integer input
    :return: Integer result or a string indicating an error condition
    """
    if x < 0:
        raise ValueError("Input must be positive")
    return x * 2


def fallback_function(x: int) -> Union[int, str]:
    """
    A sample fallback function that handles failure conditions.

    :param x: An integer input
    :return: Integer result or a string indicating an error condition
    """
    print("Fallback function is executing...")
    return -x * 3


# Create the FallbackExecutor instance
executor = FallbackExecutor(primary_function, fallback_function)

# Example with valid input
result = executor.execute(5)
print(f"Result (valid input): {result}")

# Example with invalid input
result = executor.execute(-10)
print(f"Result (invalid input): {result}")
```