"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-08 18:33:04.177320
"""

```python
from typing import Callable, Optional


class FallbackExecutor:
    """
    A class that provides a mechanism for executing functions with fallbacks in case of errors.
    
    Attributes:
        main_function (Callable): The primary function to execute.
        fallback_function (Optional[Callable]): The function to execute if the main function fails.
    """
    
    def __init__(self, main_function: Callable, fallback_function: Optional[Callable] = None):
        self.main_function = main_function
        self.fallback_function = fallback_function
    
    def execute(self) -> Optional[str]:
        """Executes the main function. If it raises an exception and a fallback is provided,
           executes the fallback function instead and returns its result.
           
           Returns:
               The return value of the executed function or None if both fail.
        """
        try:
            return self.main_function()
        except Exception as e:
            if self.fallback_function is not None:
                print(f"Main function failed: {e}. Executing fallback...")
                return self.fallback_function()
            else:
                print("Main and fallback functions failed.")
                return None


# Example usage
def main_task() -> str:
    """A simple task that may fail"""
    # Simulate a failure condition
    raise ValueError("Task execution failed unexpectedly")
    
def backup_task() -> str:
    """A simple backup task to handle if the main task fails"""
    return "Executing fallback task..."

# Create an instance of FallbackExecutor
executor = FallbackExecutor(main_task, backup_task)

# Execute and observe output
result = executor.execute()
print(f"Result: {result}")
```