Files
jiangchang-platform-kit/src/jiangchang_desktop_wake/errors.py
chendelian 71091e38a9
All checks were successful
Publish Python Package to Gitea / publish (push) Successful in 29s
feat(desktop-wake): add WeCom UIA warm-tree and ship n2-wake in 1.2.3
Expose ensure_ui_ready via DuiLib GetAccessible inject path; package x86 native helpers for host/skill consumers.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-02 08:42:38 +08:00

31 lines
922 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""桌面 Provider 暖树错误码(stdout / 异常消息前缀)。"""
from __future__ import annotations
ERR_WINDOW_NOT_FOUND = "ERROR:WINDOW_NOT_FOUND"
ERR_UIA_UNAVAILABLE = "ERROR:UIA_UNAVAILABLE"
ERR_PROVIDER_COLD = "ERROR:PROVIDER_COLD"
ERR_WAKE_FAILED = "ERROR:WAKE_FAILED"
ERR_UNSUPPORTED_OS = "ERROR:UNSUPPORTED_OS"
ERR_PROFILE_NOT_FOUND = "ERROR:PROFILE_NOT_FOUND"
__all__ = [
"ERR_WINDOW_NOT_FOUND",
"ERR_UIA_UNAVAILABLE",
"ERR_PROVIDER_COLD",
"ERR_WAKE_FAILED",
"ERR_UNSUPPORTED_OS",
"ERR_PROFILE_NOT_FOUND",
"DesktopWakeError",
]
class DesktopWakeError(RuntimeError):
"""暖树失败;``code`` 为稳定错误码(无 ERROR: 前缀)。"""
def __init__(self, code: str, message: str):
self.code = code
self.message = message
prefix = code if code.startswith("ERROR:") else f"ERROR:{code}"
super().__init__(f"{prefix}: {message}")