Class CaptchaRateLimitException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
cloud.opencode.base.captcha.exception.CaptchaException
cloud.opencode.base.captcha.exception.CaptchaRateLimitException
- All Implemented Interfaces:
Serializable
Captcha Rate Limit Exception - Thrown when rate limit is exceeded
验证码速率限制异常 - 当超过速率限制时抛出
Features | 主要功能:
- Carries client ID and optional retry-after duration - 携带客户端 ID 和可选的重试等待时间
- Extends CaptchaException - 继承 CaptchaException
Usage Examples | 使用示例:
throw new CaptchaRateLimitException(clientId);
throw new CaptchaRateLimitException(clientId, Duration.ofMinutes(1));
Security | 安全性:
- Thread-safe: Yes (immutable after construction) - 线程安全: 是(构造后不可变)
- Null-safe: No (clientId may be null) - 空值安全: 否(clientId 可能为空)
- Since:
- JDK 25, opencode-base-captcha V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCaptchaRateLimitException(String clientId) Constructs a new exception with the client ID.CaptchaRateLimitException(String clientId, Duration retryAfter) Constructs a new exception with client ID and retry duration. -
Method Summary
Modifier and TypeMethodDescriptionGets the client ID.Gets the retry after duration.Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
CaptchaRateLimitException
Constructs a new exception with the client ID. 使用客户端 ID 构造新异常。- Parameters:
clientId- the client ID | 客户端 ID
-
CaptchaRateLimitException
-
-
Method Details
-
getClientId
-
getRetryAfter
Gets the retry after duration. 获取重试等待时间。- Returns:
- the retry after duration | 重试等待时间
-