"""Create recovery_planner
Generated by Phi-Octopus Eden
2025-11-06 18:16:24.782779
"""

```python
from typing import Callable, List


class RecoveryPlanner:
    """
    A class for managing limited error recovery processes.

    Attributes:
        max_recovery_attempts (int): The maximum number of times a task can be attempted before failing.
        error_handler (Callable[[str], None]): A function to handle errors during the recovery process.
    """

    def __init__(self, max_recovery_attempts: int = 3, error_handler: Callable[[str], None] = print):
        """
        Initialize the RecoveryPlanner.

        Args:
            max_recovery_attempts (int): The maximum number of attempts allowed. Default is 3.
            error_handler (Callable[[str], None]): A function to handle errors. Default prints the error message.
        """
        self.max_recovery_attempts = max_recovery_attempts
        self.error_handler = error_handler

    def plan_recovery(self, task: Callable[[], str]) -> List[str]:
        """
        Plan and execute recovery for a given task.

        Args:
            task (Callable[[], str]): A function that performs the task and returns an error message if it fails.

        Returns:
            List[str]: The success messages or error messages collected during attempts.
        """
        results = []
        attempt_count = 0
        while attempt_count < self.max_recovery_attempts:
            try:
                result = task()
                # Assuming task() returns a string, append the result to the list if successful
                if isinstance(result, str) and result.strip():  # Strip to avoid empty strings
                    results.append(result)
                    break
            except Exception as e:
                self.error_handler(f"Error during recovery attempt {attempt_count + 1}: {str(e)}")
                attempt_count += 1

        return results


# Example usage
def example_task() -> str:
    """
    An example task that may fail and should be recovered.
    """
    import random
    if random.random() < 0.5:  # Simulate a 50% failure rate
        raise ValueError("Simulated task error")
    return "Task completed successfully"


# Create an instance of RecoveryPlanner with custom settings
recovery_planner = RecoveryPlanner(max_recovery_attempts=5, error_handler=lambda x: print(f"Custom handler: {x}"))

# Plan and execute recovery for the example task
results = recovery_planner.plan_recovery(example_task)

print("Results:", results)
```