"""Create error_monitor
Generated by Phi-Octopus Eden
2025-11-08 19:47:56.852741
"""

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


class ErrorMonitor:
    """
    A class for monitoring and handling errors in a system.
    
    Attributes:
        error_handlers: A dictionary mapping exception types to their corresponding handler functions.
    """

    def __init__(self):
        self.error_handlers = {}

    def add_error_handler(self, exc_type: type, handler: Callable[[Exception], None]) -> None:
        """
        Adds an error handler for a specific exception type.

        Args:
            exc_type (type): The exception type to handle.
            handler (Callable[[Exception], None]): A function that takes an Exception and returns None.

        Raises:
            TypeError: If the `handler` is not callable or if `exc_type` is not a valid exception class.
        """
        if not callable(handler):
            raise TypeError("Handler must be a callable function")
        
        if exc_type is not None and not isinstance(exc_type, type) or not issubclass(exc_type, Exception):
            raise TypeError("Exc_type must be an instance of `type` and subclass of `Exception`")
        
        self.error_handlers[exc_type] = handler

    def monitor(self, func: Callable[..., Any]) -> Callable[..., Any]:
        """
        Decorator to wrap a function with error monitoring.

        Args:
            func (Callable[..., Any]): The function to be wrapped.

        Returns:
            Callable[..., Any]: A decorated version of the input function.
        """

        def wrapper(*args, **kwargs) -> Any:
            try:
                return func(*args, **kwargs)
            except Exception as e:
                if type(e) in self.error_handlers:
                    self.error_handlers[type(e)](e)
                else:
                    raise

        return wrapper


# Example usage
def divide(a: float, b: float) -> float:
    """Example function that may raise a ZeroDivisionError."""
    return a / b


def handle_zero_division_error(e: Exception) -> None:
    print(f"Error occurred: {e}")


def main() -> None:
    error_monitor = ErrorMonitor()
    error_monitor.add_error_handler(ZeroDivisionError, handle_zero_division_error)

    @error_monitor.monitor
    def safe_divide(a: float, b: float) -> float:
        return divide(a, b)

    result = safe_divide(10, 2)  # This should succeed and print "5.0"
    print(result)
    try:
        result = safe_divide(10, 0)  # This should raise an error and be handled
    except ZeroDivisionError as e:
        print(f"Caught: {e}")


if __name__ == "__main__":
    main()
```