"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-07 14:16:30.973697
"""

```python
from typing import Any, Callable


class FallbackExecutor:
    """
    A class that provides a mechanism for executing a main task with fallbacks in case of failure.
    
    This can be particularly useful when dealing with limited error recovery scenarios where a primary execution 
    fails but there are alternative methods or actions to take.

    Args:
        main_task: Callable function representing the main task to be executed.
        fallback_tasks: A list of Callables, each representing a fallback action in case the main_task fails.
    
    Raises:
        RuntimeError: If no fallback tasks are provided and main_task execution fails.
    """

    def __init__(self, main_task: Callable[..., Any], fallback_tasks: list[Callable[..., Any]] = None):
        self.main_task = main_task
        if fallback_tasks is None:
            fallback_tasks = []
        self.fallback_tasks = fallback_tasks

    def execute(self) -> Any:
        """
        Execute the main task. If it fails, attempt to run each of the fallback tasks in sequence until one succeeds.

        Returns:
            The output of the first non-failing function or the main task.
        
        Raises:
            RuntimeError: If all fallbacks fail and the main task execution fails.
        """
        try:
            return self.main_task()
        except Exception as e:
            for fallback in self.fallback_tasks:
                try:
                    return fallback()
                except Exception as fe:
                    continue
            raise RuntimeError("All fallback tasks failed, and initial main task raised an error.") from e


# Example usage

def primary_task() -> int:
    """A sample function that may fail due to invalid assumptions"""
    if not 1:  # Intentionally making it fail for example purposes.
        raise ValueError("Primary Task Failure")
    return 42


def fallback1() -> int:
    print("Executing first fallback")
    return 43


def fallback2() -> int:
    print("Executing second fallback")
    return 44


# Create an instance of FallbackExecutor with primary and fallback functions
executor = FallbackExecutor(main_task=primary_task, fallback_tasks=[fallback1, fallback2])

try:
    result = executor.execute()
    print(f"Result: {result}")
except RuntimeError as error:
    print(f"Error occurred: {error}")

```