"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-07 19:54:37.460266
"""

```python
from typing import Callable


class FallbackExecutor:
    """
    A class for creating a fallback mechanism in executing functions.
    
    Attributes:
        primary_function (Callable): The main function to be executed.
        fallback_function (Callable, optional): The function that will execute if the primary function fails. Defaults to None.
        
    Methods:
        run: Executes the primary function and handles exceptions by running the fallback function if provided.
    """
    
    def __init__(self, primary_function: Callable, fallback_function: Callable = None):
        self.primary_function = primary_function
        self.fallback_function = fallback_function
    
    def run(self) -> None:
        """
        Attempts to execute `primary_function`. If an exception occurs,
        the method will try executing `fallback_function` if provided.
        
        Raises:
            Exception: If no fallback function is provided and an error occurs.
        """
        try:
            self.primary_function()
        except Exception as e:
            if self.fallback_function:
                print(f"Primary function failed with exception: {e}")
                self.fallback_function()
            else:
                raise e


# Example usage
def primary() -> None:
    """Prints a message and raises an exception."""
    print("Executing the primary function...")
    raise ValueError("This is an intentional error.")


def fallback() -> None:
    """A simple fallback function that prints an error message."""
    print("Fallback function executed because of the primary function's failure.")


# Creating an instance and running it
executor = FallbackExecutor(primary, fallback)
executor.run()

# Attempting to run with no fallback (should raise an exception)
no_fallback_executor = FallbackExecutor(primary)
no_fallback_executor.run()
```