"""Plugin exception hierarchy.

Defines domain-specific exceptions for the plugin architecture
framework.  All plugin exceptions inherit from :class:`PluginError`.

Based on issue #585.
"""

from __future__ import annotations


class PluginError(Exception):
    """Base exception for all plugin-related errors."""


class PluginLoadError(PluginError):
    """Raised when a plugin module cannot be found or imported.

    This covers ``ImportError`` (module not found) and
    ``AttributeError`` (class not found in module) during dynamic
    loading.
    """


class PluginNotFoundError(PluginError):
    """Raised when a requested plugin is not in the registry."""


class ProtocolMismatchError(PluginError):
    """Raised when a loaded class does not satisfy the expected Protocol.

    The plugin was successfully imported but its class does not
    implement the required ``@runtime_checkable`` Protocol interface.
    """
