class AliasUtilsException(Exception):
    """Custom exception for Alias Utils errors."""

    def __init__(self, message, status_code=400, details=None):
        """
        Initialize the exception with a message, status code, and additional details.

        :param message: Error message to be displayed.
        :param status_code: HTTP status code to return.
        :param details: Any additional data related to the error.
        """
        self.message = message
        self.status_code = status_code
        self.details = details or {}

    def to_dict(self):
        """Return the error in dictionary (JSON) format."""
        error_response = {
            "error": self.message,
            "status_code": self.status_code,
        }
        if self.details:
            error_response["details"] = self.details
        return error_response


class AdapterException(Exception):
    pass
