Files
MoviePilot/app/schemas/exception.py
2024-09-04 20:10:41 +08:00

32 lines
1.0 KiB
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.
class ImmediateException(Exception):
"""
用于立即抛出异常而不重试的特殊异常类。
当不希望使用重试机制时,可以抛出此异常。
"""
pass
class LimitException(ImmediateException):
"""
用于表示本地限流器或外部触发的限流异常的基类。
该异常类可用于本地限流逻辑或外部限流处理。
"""
pass
class APIRateLimitException(LimitException):
"""
用于表示API速率限制的异常类。
当API调用触发速率限制时可以抛出此异常以立即终止操作并报告错误。
"""
pass
class RateLimitExceededException(LimitException):
"""
用于表示本地限流器触发的异常类。
当函数调用频率超过限流器的限制时,可以抛出此异常以停止当前操作并告知调用者限流情况。
这个异常通常用于本地限流逻辑(例如 RateLimiter当系统检测到函数调用频率过高时触发限流并抛出该异常。
"""
pass