"""Create recovery_planner
Generated by Phi-Octopus Eden
2025-11-06 21:45:11.633547
"""

```python
from typing import Callable, Any


class RecoveryPlanner:
    """
    A class that provides a structured way to recover from limited errors in a system.
    
    Attributes:
        error_handler (Callable[[Exception], None]): The function called when an error occurs during execution.
                                                    It should accept the exception as its parameter and return nothing.
    
    Methods:
        plan_recovery: Takes an action function, wraps it with recovery logic,
                       and returns a new callable that handles errors gracefully.
    """
    
    def __init__(self, error_handler: Callable[[Exception], None]):
        self.error_handler = error_handler
    
    def plan_recovery(self, action: Callable[..., Any]) -> Callable[..., Any]:
        """
        Wraps the provided action function with error recovery logic.

        Args:
            action (Callable): The function to be executed and potentially recovered from errors.

        Returns:
            Callable: A new callable that includes error handling.
        """
        def recover_from_error(*args, **kwargs):
            try:
                return action(*args, **kwargs)
            except Exception as e:
                self.error_handler(e)
        
        return recover_from_error


# Example usage

def perform_critical_operation() -> int:
    """A function simulating a critical operation that can fail."""
    import random
    if random.randint(0, 1) == 0:  # Simulate failure with probability 50%
        raise ValueError("Operation failed unexpectedly.")
    return 42


# Define the error handler to log errors or take specific actions
def default_error_handler(exception: Exception):
    print(f"Error occurred: {exception}")


# Create a recovery planner and plan for the critical operation
recovery_planner = RecoveryPlanner(default_error_handler)
safe_operation = recovery_planner.plan_recovery(perform_critical_operation)

# Execute the safe version of the operation, which handles errors gracefully
result = safe_operation()
print(f"Operation result: {result}")
```