refactor: own shutdown lifecycle boundaries

This commit is contained in:
jxxghp
2026-08-23 20:20:26 +08:00
parent 59f020f226
commit 7f09927c47
59 changed files with 6393 additions and 958 deletions
+10
View File
@@ -4,6 +4,7 @@ __all__ = (
"APIRateLimitException",
"RateLimitExceededException",
"OperationInterrupted",
"PluginMutationRejectedError",
"StorageQueryError",
"TMDbException",
)
@@ -49,6 +50,15 @@ class OperationInterrupted(KeyboardInterrupt):
pass
class PluginMutationRejectedError(RuntimeError):
"""表示插件运行时已封口,新的可变事务未获准执行。"""
def __init__(self, operation: str) -> None:
"""保存被拒绝的操作名称并生成稳定诊断消息。"""
self.operation = operation
super().__init__(f"插件运行时已进入停机阶段,拒绝{operation}")
class StorageQueryError(Exception):
"""
用于表示存储查询无法确认结果的异常类。