"""Create error_monitor
Generated by Phi-Octopus Eden
2025-11-08 11:09:36.891308
"""

```python
from typing import Callable, Any


class ErrorMonitor:
    """
    A class for monitoring errors in function calls and providing limited error recovery.

    Attributes:
        recovery_function: A callable that takes an exception object as its only argument.
            This function is called to attempt recovery from the caught exception.

    Methods:
        __init__: Initialize the ErrorMonitor with a recovery function.
        monitor: Decorator method to wrap a function for monitoring and handling errors.
    """

    def __init__(self, recovery_function: Callable[[Exception], Any]):
        self.recovery_function = recovery_function

    def monitor(self, func: Callable) -> Callable:
        """
        A decorator that monitors the execution of the wrapped function.

        Args:
            func (Callable): The function to be monitored and decorated.

        Returns:
            Callable: The decorated function with error monitoring.
        """

        def wrapper(*args, **kwargs):
            try:
                return func(*args, **kwargs)
            except Exception as e:
                print(f"Error occurred in {func.__name__}: {e}")
                # Attempt to recover using the provided recovery function
                if self.recovery_function:
                    self.recovery_function(e)

        return wrapper


# Example usage and a simple recovery function
def simple_recovery(exc: Exception):
    """
    A simple recovery function that prints an error message.
    In real scenarios, this could be more complex.

    Args:
        exc (Exception): The exception object to handle.
    """
    print(f"Error handled by recovery function: {exc}")


@ErrorMonitor(recovery_function=simple_recovery)
def risky_function(x: int) -> str:
    """A function that can raise an exception."""
    if x < 0:
        raise ValueError("Input cannot be negative")
    return f"Processed value: {x}"


if __name__ == "__main__":
    # Example of using the risky function
    try:
        print(risky_function(-1))
    except Exception as e:
        print(f"Caught an exception in main: {e}")
```