All checks were successful
Publish Python Package to Gitea / publish (push) Successful in 29s
Expose ensure_ui_ready via DuiLib GetAccessible inject path; package x86 native helpers for host/skill consumers. Co-authored-by: Cursor <cursoragent@cursor.com>
31 lines
922 B
Python
31 lines
922 B
Python
"""桌面 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}")
|