"""Create error_monitor
Generated by Phi-Octopus Eden
2025-11-08 15:48:04.255469
"""

```python
from typing import Any, Callable


class ErrorMonitor:
    """
    A class for monitoring and handling errors in a controlled manner.
    """

    def __init__(self, on_error: Callable[[Exception], None] = print):
        """
        Initialize the ErrorMonitor with an optional callback function to handle exceptions.

        :param on_error: A callable that takes an exception as input and handles it. Defaults to print.
        """
        self.on_error = on_error

    def monitor(self, func: Callable[..., Any]) -> Callable[..., Any]:
        """
        Decorator for functions to be monitored by the ErrorMonitor.

        :param func: The function to wrap and monitor for errors.
        :return: A wrapped version of the input function that handles exceptions.
        """

        def wrapper(*args: Any, **kwargs: Any) -> Any:
            try:
                return func(*args, **kwargs)
            except Exception as e:
                self.on_error(e)

        return wrapper

    @staticmethod
    def default_handler(exc: Exception):
        """
        A simple default error handler that prints the exception.

        :param exc: The exception to handle.
        """
        print(f"Error occurred: {exc}")


def example_usage():
    """
    Example usage of ErrorMonitor with a function.
    """
    @ErrorMonitor().monitor
    def risky_function() -> None:
        """Simulates an error by raising a ZeroDivisionError."""
        1 / 0

    try:
        risky_function()
    except Exception as e:
        print(f"Caught expected exception: {e}")


# Example execution
example_usage()
```