"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-08 08:13:12.990039
"""

```python
class FallbackExecutor:
    """
    A class for executing a task with fallback options in case of errors.
    
    This implementation allows setting up multiple fallback functions that will be tried
    one by one if the primary function or any of its fallbacks raise an exception.

    :param func: The main function to execute. It should take the same arguments as the fallbacks.
    :type func: Callable
    :param fallbacks: A list of fallback functions, each taking the same arguments as `func`.
                      These will be tried in order if an exception is raised by `func` or a previous fallback.
    :type fallbacks: List[Callable]
    """

    def __init__(self, func: Callable, fallbacks: List[Callable] = None):
        self.func = func
        self.fallbacks = fallbacks if fallbacks else []

    def execute(self, *args, **kwargs) -> Any:
        """
        Executes the main function and handles any exceptions by attempting each fallback.

        :param args: Arguments to pass to the functions.
        :param kwargs: Keyword arguments to pass to the functions.
        :return: The result of the successfully executed function.
        :raises Exception: If all functions raise an exception.
        """
        try:
            return self.func(*args, **kwargs)
        except Exception as e:
            for fallback in self.fallbacks:
                try:
                    return fallback(*args, **kwargs)
                except Exception as ex:
                    pass
            raise Exception("All fallbacks failed.") from e

# Example usage
def primary_function(x):
    if x < 0:
        raise ValueError("Negative value not allowed.")
    return x * 2

def fallback_function1(x):
    print("Fallback function 1 called with", x)
    return x + 5

def fallback_function2(x):
    print("Fallback function 2 called with", x)
    return x - 3

# Creating an instance of FallbackExecutor
executor = FallbackExecutor(primary_function, [fallback_function1, fallback_function2])

# Example call to the executor
result = executor.execute(-10)  # This will trigger fallback functions
print("Result:", result)

result = executor.execute(5)   # No exception, so primary function is called
print("Result:", result)
```