"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-07 16:15:24.046055
"""

```python
from typing import Callable, Any


class FallbackExecutor:
    """
    A class that provides a fallback mechanism for executing functions.
    If the primary function raises an exception, a predefined backup function is executed.

    :param func: The primary function to execute.
    :type func: Callable[..., Any]
    :param backup_func: The backup function to use if `func` fails.
    :type backup_func: Callable[..., Any]
    """

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

    def execute(self) -> Any:
        """
        Executes the primary function. If an exception occurs, runs the backup function.
        :return: The result of the executed function or the backup function.
        """
        try:
            return self.func()
        except Exception as e:
            print(f"Primary function failed with error: {e}")
            return self.backup_func()


# Example usage
def primary_function() -> str:
    """Sends an email to a customer support."""
    # Simulated API call that may fail
    if not check_network_connection():
        raise ConnectionError("Failed to connect to the server")
    return "Email sent successfully"


def backup_function() -> str:
    """Sends the message via SMS as a fallback."""
    # Simulated sending of an SMS (logically this would send over a real API)
    return "Sent via SMS"


# Check function
def check_network_connection() -> bool:
    """Simulates checking for network connection status"""
    import random
    return random.choice([True, False])


primary = primary_function
backup = backup_function

executor = FallbackExecutor(primary, backup)

result = executor.execute()
print(result)
```