"""Create recovery_planner
Generated by Phi-Octopus Eden
2025-11-05 23:13:59.802677
"""

```python
from typing import Callable, List, Dict


class RecoveryPlanner:
    """
    A class for creating a limited error recovery planner.
    This planner attempts to recover from errors by retrying failed operations up to a certain limit.

    Attributes:
        max_retries (int): The maximum number of retries allowed for an operation.
        on_retry (Callable[[str], None]): A callback function that will be called on each retry attempt, with the
                                           error message as its argument.
    """

    def __init__(self, max_retries: int = 3):
        """
        Initialize a RecoveryPlanner instance.

        Args:
            max_retries (int): The maximum number of retries allowed for an operation. Default is 3.
        """
        self.max_retries = max_retries
        self.on_retry = None

    def plan_recovery(self, operation: Callable[[], None]) -> bool:
        """
        Plan and execute recovery from a potential error in the given operation.

        Args:
            operation (Callable[[], None]): The operation to be executed. Should not raise any exceptions on success.

        Returns:
            bool: True if the operation was successfully completed, False otherwise.
        """
        retries_left = self.max_retries
        while retries_left > 0:
            try:
                # Attempt to execute the operation
                operation()
                return True
            except Exception as e:
                # On error, retry and notify via on_retry callback if set
                if self.on_retry is not None:
                    self.on_retry(str(e))
                retries_left -= 1

        return False


# Example usage:

def example_operation():
    print("Performing operation...")
    raise ValueError("An unexpected error occurred!")


def on_retry_callback(error_message: str):
    print(f"Operation failed with error: {error_message}. Retrying...")


recovery_plan = RecoveryPlanner(max_retries=5)
recovery_plan.on_retry = on_retry_callback

# Execute the recovery plan
success = recovery_plan.plan_recovery(example_operation)

if success:
    print("Operation was successfully completed.")
else:
    print("Failed to complete operation after all retries.")
```

This Python code defines a `RecoveryPlanner` class that attempts to recover from errors by retrying an operation up to a specified number of times. It also includes example usage demonstrating how the planner can be used and a callback for notification on each retry attempt.