"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-05 21:38:11.617451
"""

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


class FallbackExecutor:
    """
    A class that provides a mechanism for executing a function with fallbacks in case of failure.
    
    Attributes:
        main_executor (Callable): The primary function to execute.
        fallback_executors (List[Callable]): List of functions to try if the main executor fails.
        exception_types (Tuple[type, ...]): Tuple of exception types to catch during execution.

    Methods:
        run: Executes the main function and falls back on the next in line until it succeeds or runs out of options.
    """

    def __init__(self, main_executor: Callable, fallback_executors: Optional[list] = None,
                 exception_types: Optional[tuple] = (Exception,)):
        self.main_executor = main_executor
        self.fallback_executors = [] if not fallback_executors else fallback_executors
        self.exception_types = exception_types

    def run(self) -> Any:
        """
        Executes the main function and falls back on the next in line until it succeeds or runs out of options.

        Returns:
            The result of the successful execution.
        
        Raises:
            Exception: If no fallbacks are available and all functions fail.
        """
        executors = [self.main_executor] + self.fallback_executors
        for executor in executors:
            try:
                return executor()
            except self.exception_types as e:
                continue

        raise Exception("All provided functions failed with the given exception types.")


# Example usage:

def main_function():
    """Simulates a function that may fail."""
    print("Running main function...")
    # Simulating an error condition
    raise ValueError("Something went wrong in the main function")

def fallback1():
    """A simple fallback function."""
    print("Executing fallback 1...")
    return "Fallback 1 result"

def fallback2():
    """Another fallback function that might fail as well."""
    print("Executing fallback 2...")
    # Simulating an error condition
    raise ValueError("Fallback 2 failed too")


# Create the FallbackExecutor instance and run it.
fallback_executor = FallbackExecutor(main_function, [fallback1, fallback2])
result = fallback_executor.run()
print(f"Final result: {result}")
```

This code snippet demonstrates a `FallbackExecutor` class designed to handle situations where a primary function might fail. It includes methods for adding fallback functions and running the execution with error handling. The example usage section shows how this can be utilized in a practical scenario, allowing for graceful degradation when faced with unexpected errors.