from __future__ import annotations

from datetime import datetime, timezone


class DesktopAutomationError(Exception):
    """Raised when desktop automation fails."""


def _utc_timestamp() -> str:
    return datetime.now(timezone.utc).isoformat()


def _normalize_error(err: Exception) -> str:
    msg = str(err).strip()
    return msg if msg else err.__class__.__name__
