mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-08-31 13:07:56 +08:00
- mTorrent 字幕链接解析下沉为 IndexerModule.site_subtitle_links,subtitle 模块自行跳过 API 站点 - TMDB/MusicBrainz 识别缓存管理改为模块方法(tmdb_cache_*/music_cache_*)经 run_module 分发 - WechatClawBot 客户端查找/临时客户端/缓存迁移内聚为 wechatclawbot_* 模块方法, chain 移除 WechatClawBot 类与 ModuleManager 内省 - LISTENBRAINZ_* 常量迁至 schemas/types.py,模块与链层再导入保持兼容 - TMDbException 升为 schemas/exception.py 跨层契约,vendored 异常保持类身份一致 - 架构守护测试新增 test_chain_does_not_import_module_internals(共 18 项) - 文档同步:chain->module 仅允许 run_module 分发,直接导入禁止
57 lines
1.7 KiB
Python
57 lines
1.7 KiB
Python
class ImmediateException(Exception):
|
|
"""
|
|
用于立即抛出异常而不重试的特殊异常类。
|
|
当不希望使用重试机制时,可以抛出此异常。
|
|
"""
|
|
pass
|
|
|
|
|
|
class LimitException(ImmediateException):
|
|
"""
|
|
用于表示本地限流器或外部触发的限流异常的基类。
|
|
该异常类可用于本地限流逻辑或外部限流处理。
|
|
"""
|
|
pass
|
|
|
|
|
|
class APIRateLimitException(LimitException):
|
|
"""
|
|
用于表示API速率限制的异常类。
|
|
当API调用触发速率限制时,可以抛出此异常以立即终止操作并报告错误。
|
|
"""
|
|
pass
|
|
|
|
|
|
class RateLimitExceededException(LimitException):
|
|
"""
|
|
用于表示本地限流器触发的异常类。
|
|
当函数调用频率超过限流器的限制时,可以抛出此异常以停止当前操作并告知调用者限流情况。
|
|
这个异常通常用于本地限流逻辑(例如 RateLimiter),当系统检测到函数调用频率过高时,触发限流并抛出该异常。
|
|
"""
|
|
pass
|
|
|
|
|
|
class OperationInterrupted(KeyboardInterrupt):
|
|
"""
|
|
用于表示操作被中断
|
|
"""
|
|
pass
|
|
|
|
|
|
class StorageQueryError(Exception):
|
|
"""
|
|
用于表示存储查询无法确认结果的异常类。
|
|
当文件信息查询因网络、限流或接口错误失败(区别于「确认不存在」)时抛出,
|
|
调用方不应把该状态当作文件不存在处理。
|
|
"""
|
|
pass
|
|
|
|
|
|
class TMDbException(Exception):
|
|
"""
|
|
用于表示TheMovieDB数据源请求失败的跨层异常契约。
|
|
具体实现由TMDB模块内的异常子类继承本类,链层与API层只捕获本基类,
|
|
不依赖模块内部实现路径。
|
|
"""
|
|
pass
|