异常处理模块
异常处理模块提供统一的异常管理和状态码系统。
异常类
- exception Utils.Exceptions.OrionException(message: str, code: int = None, details: dict | None = None)[源代码]
基类:
Exception
OrionLauncher异常基类
所有自定义异常都应继承此类,以便于统一处理和识别。
- exception Utils.Exceptions.CoreException(message: str, code: int = None, details: dict | None = None)[源代码]
-
核心模块异常基类
- exception Utils.Exceptions.NetworkException(message: str, code: int = None, details: dict | None = None)[源代码]
-
网络相关异常基类
- exception Utils.Exceptions.DownloadException(message: str, code: int = None, details: dict | None = None)[源代码]
-
下载异常
- exception Utils.Exceptions.ApiException(message: str, code: int = None, details: dict | None = None)[源代码]
-
API调用异常
- exception Utils.Exceptions.AuthenticationException(message: str, code: int = None, details: dict | None = None)[源代码]
-
认证异常
- exception Utils.Exceptions.FileSystemException(message: str, code: int = None, details: dict | None = None)[源代码]
-
文件系统相关异常基类
- exception Utils.Exceptions.FileNotFoundException(message: str, code: int = None, details: dict | None = None)[源代码]
-
文件未找到异常
- exception Utils.Exceptions.FilePermissionException(message: str, code: int = None, details: dict | None = None)[源代码]
-
文件权限异常
- exception Utils.Exceptions.FileOperationException(message: str, code: int = None, details: dict | None = None)[源代码]
-
文件操作异常
- exception Utils.Exceptions.ConfigException(message: str, code: int = None, details: dict | None = None)[源代码]
-
配置相关异常基类
- exception Utils.Exceptions.InvalidConfigException(message: str, code: int = None, details: dict | None = None)[源代码]
-
无效配置异常
- exception Utils.Exceptions.ConfigNotFoundException(message: str, code: int = None, details: dict | None = None)[源代码]
-
配置未找到异常
- exception Utils.Exceptions.GameException(message: str, code: int = None, details: dict | None = None)[源代码]
-
游戏相关异常基类
- exception Utils.Exceptions.GameLaunchException(message: str, code: int = None, details: dict | None = None)[源代码]
-
游戏启动异常
- exception Utils.Exceptions.GameInstallException(message: str, code: int = None, details: dict | None = None)[源代码]
-
游戏安装异常
- exception Utils.Exceptions.ControllerException(message: str, code: int = None, details: dict | None = None)[源代码]
-
控制器异常基类
- exception Utils.Exceptions.InitializationException(message: str, code: int = None, details: dict | None = None)[源代码]
-
初始化异常
- exception Utils.Exceptions.AsyncTaskException(message: str, code: int = None, details: dict | None = None)[源代码]
-
异步任务异常
- exception Utils.Exceptions.ViewException(message: str, code: int = None, details: dict | None = None)[源代码]
-
视图异常基类
- exception Utils.Exceptions.UIException(message: str, code: int = None, details: dict | None = None)[源代码]
-
UI相关异常
- exception Utils.Exceptions.UtilsException(message: str, code: int = None, details: dict | None = None)[源代码]
-
工具异常基类
- exception Utils.Exceptions.RepositoryException(message: str, code: int = None, details: dict | None = None)[源代码]
-
仓库异常
- exception Utils.Exceptions.WrappedSystemException(original_exception: Exception, message: str | None = None)[源代码]
-
系统异常包装器
用于包装系统异常,将其转换为OrionException
异常状态码
OrionLauncher异常状态码定义
异常状态码采用5位数字格式:XYZAB │││││ │││└┴─ 具体异常类型 (01-99) ││└─── 子模块类型 (0-9) │└──── 主模块类型 (0-9) └───── 应用层级 (1-9)
应用层级分配: 1 - Core层异常 2 - Controller层异常 3 - View层异常 4 - Utils层异常 9 - 系统异常包装器
- class Utils.Exceptions.code.CoreErrorCodes[源代码]
基类:
object
Core层异常状态码
- CORE_GENERAL_ERROR = 10001
- CORE_INITIALIZATION_ERROR = 10002
- CORE_UNKNOWN_ERROR = 10099
- NETWORK_GENERAL_ERROR = 11001
- NETWORK_CONNECTION_ERROR = 11002
- NETWORK_TIMEOUT_ERROR = 11003
- NETWORK_DNS_ERROR = 11004
- NETWORK_SSL_ERROR = 11005
- DOWNLOAD_GENERAL_ERROR = 11101
- DOWNLOAD_FILE_NOT_FOUND = 11102
- DOWNLOAD_PERMISSION_DENIED = 11103
- DOWNLOAD_DISK_FULL = 11104
- DOWNLOAD_CHECKSUM_MISMATCH = 11105
- DOWNLOAD_INTERRUPTED = 11106
- DOWNLOAD_SPEED_TOO_SLOW = 11107
- API_GENERAL_ERROR = 11201
- API_INVALID_REQUEST = 11202
- API_UNAUTHORIZED = 11203
- API_FORBIDDEN = 11204
- API_NOT_FOUND = 11205
- API_SERVER_ERROR = 11206
- API_RATE_LIMITED = 11207
- API_INVALID_RESPONSE = 11208
- AUTH_GENERAL_ERROR = 11301
- AUTH_INVALID_CREDENTIALS = 11302
- AUTH_TOKEN_EXPIRED = 11303
- AUTH_TOKEN_INVALID = 11304
- AUTH_PERMISSION_DENIED = 11305
- AUTH_ACCOUNT_LOCKED = 11306
- AUTH_MFA_REQUIRED = 11307
- FILESYSTEM_GENERAL_ERROR = 12001
- FILE_NOT_FOUND = 12101
- FILE_PERMISSION_DENIED = 12102
- FILE_ALREADY_EXISTS = 12103
- FILE_IN_USE = 12104
- FILE_CORRUPTED = 12105
- FILE_TOO_LARGE = 12106
- DIRECTORY_NOT_FOUND = 12201
- DIRECTORY_PERMISSION_DENIED = 12202
- DIRECTORY_NOT_EMPTY = 12203
- DIRECTORY_CREATION_FAILED = 12204
- CONFIG_GENERAL_ERROR = 13001
- CONFIG_NOT_FOUND = 13002
- CONFIG_INVALID_FORMAT = 13003
- CONFIG_VALIDATION_FAILED = 13004
- CONFIG_SAVE_FAILED = 13005
- CONFIG_LOAD_FAILED = 13006
- GAME_GENERAL_ERROR = 14001
- GAME_LAUNCH_FAILED = 14101
- GAME_EXECUTABLE_NOT_FOUND = 14102
- GAME_INCOMPATIBLE_SYSTEM = 14103
- GAME_MISSING_DEPENDENCIES = 14104
- GAME_ALREADY_RUNNING = 14105
- GAME_INSTALL_FAILED = 14201
- GAME_INSTALL_SPACE_INSUFFICIENT = 14202
- GAME_INSTALL_CORRUPTED = 14203
- GAME_UNINSTALL_FAILED = 14204
- class Utils.Exceptions.code.ControllerErrorCodes[源代码]
基类:
object
Controller层异常状态码
- CONTROLLER_GENERAL_ERROR = 20001
- CONTROLLER_INITIALIZATION_FAILED = 20002
- ASYNC_TASK_FAILED = 21001
- ASYNC_TASK_TIMEOUT = 21002
- ASYNC_TASK_CANCELLED = 21003
- ASYNC_TASK_QUEUE_FULL = 21004
- ACCOUNT_CONTROLLER_ERROR = 22001
- ACCOUNT_LOGIN_FAILED = 22002
- ACCOUNT_LOGOUT_FAILED = 22003
- ACCOUNT_REFRESH_FAILED = 22004
- GAME_CONTROLLER_ERROR = 23001
- GAME_LIST_LOAD_FAILED = 23002
- GAME_INFO_FETCH_FAILED = 23003
- SETTINGS_CONTROLLER_ERROR = 24001
- SETTINGS_LOAD_FAILED = 24002
- SETTINGS_SAVE_FAILED = 24003
- class Utils.Exceptions.code.ViewErrorCodes[源代码]
基类:
object
View层异常状态码
- VIEW_GENERAL_ERROR = 30001
- VIEW_INITIALIZATION_FAILED = 30002
- UI_COMPONENT_ERROR = 31001
- UI_RENDER_ERROR = 31002
- UI_EVENT_HANDLER_ERROR = 31003
- UI_RESOURCE_LOAD_ERROR = 31004
- WINDOW_CREATION_FAILED = 32001
- WINDOW_SHOW_FAILED = 32002
- WINDOW_CLOSE_FAILED = 32003
- DIALOG_CREATION_FAILED = 33001
- DIALOG_MODAL_ERROR = 33002
- class Utils.Exceptions.code.UtilsErrorCodes[源代码]
基类:
object
Utils层异常状态码
- UTILS_GENERAL_ERROR = 40001
- REPOSITORY_ERROR = 41001
- REPOSITORY_PATH_ERROR = 41002
- REPOSITORY_ACCESS_ERROR = 41003
- class Utils.Exceptions.code.SystemErrorCodes[源代码]
基类:
object
系统异常包装器状态码
- SYSTEM_EXCEPTION_WRAPPER = 90001
- UNKNOWN_SYSTEM_ERROR = 90099
- Utils.Exceptions.code.get_error_code_for_exception(exception_class_name: str) int [源代码]
根据异常类名获取对应的错误状态码