"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-07 22:20:58.647992
"""

```python
class FallbackExecutor:
    """
    A class for executing tasks with fallback support in case of errors.

    Attributes:
        primary_executor (callable): The main function or method to execute.
        secondary_executors (list[callable]): List of functions/methods to try as fallbacks if the primary executor fails.
        error_handler (callable, optional): Function to handle exceptions during execution. Defaults to None.

    Methods:
        run: Execute the task with potential fallback support.
    """

    def __init__(self, primary_executor: callable, secondary_executors: list[callable], error_handler=None):
        self.primary_executor = primary_executor
        self.secondary_executors = secondary_executors
        self.error_handler = error_handler

    def run(self, *args, **kwargs) -> any:
        """
        Execute the task with potential fallback support.

        Parameters:
            *args: Positional arguments to pass to the executors.
            **kwargs: Keyword arguments to pass to the executors.

        Returns:
            The result of the successful execution or None if all fail.
        """
        try:
            return self.primary_executor(*args, **kwargs)
        except Exception as e:
            if self.error_handler is not None:
                self.error_handler(e)

        for fallback in self.secondary_executors:
            try:
                return fallback(*args, **kwargs)
            except Exception as e:
                if self.error_handler is not None:
                    self.error_handler(e)

        return None

# Example usage
def primary_task(x: int) -> int:
    """Add 10 to the input."""
    return x + 10

def secondary_task_1(x: int) -> int:
    """Subtract 5 from the input if it's positive."""
    if x > 0:
        return x - 5
    raise ValueError("Input is not positive")

def secondary_task_2(x: int) -> int:
    """Double the input value."""
    return x * 2

# Create a FallbackExecutor instance with primary and fallback executors
executor = FallbackExecutor(primary_task, [secondary_task_1, secondary_task_2])

# Run tasks
result = executor.run(5)
print(f"Result: {result}")  # Should print "Result: 0"

result = executor.run(-3)
print(f"Result: {result}")  # Should raise ValueError as no fallback succeeds

def error_handler(exception):
    """A simple error handler to log exceptions."""
    print(f"An error occurred: {exception}")

# Run with a custom error handler
executor_with_handler = FallbackExecutor(primary_task, [secondary_task_1, secondary_task_2], error_handler)
result = executor_with_handler.run(5)  # Logs the error but still returns None as no fallback succeeds for -3
```