Class CaptchaException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
cloud.opencode.base.core.exception.OpenException
cloud.opencode.base.captcha.exception.CaptchaException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CaptchaExpiredException, CaptchaGenerationException, CaptchaNotFoundException, CaptchaRateLimitException, CaptchaVerifyException
Captcha Exception - Base exception for CAPTCHA operations
验证码异常 - 验证码操作的基础异常
This is the base exception class for all CAPTCHA-related exceptions.
It extends OpenException to integrate with the unified OpenCode
exception hierarchy, providing error code and component name support.
这是所有验证码相关异常的基础异常类。
继承 OpenException 以融入 OpenCode 统一异常体系,支持错误码和组件名称。
Features | 主要功能:
- Base exception for CAPTCHA exception hierarchy - 验证码异常层次的基础异常
- Extends OpenException with component="Captcha" - 继承 OpenException,组件名="Captcha"
- Supports message, cause, errorCode, and combined constructors - 支持消息、原因、错误码和组合构造器
- Formatted getMessage(): [Captcha] (errorCode) message - 格式化消息
Usage Examples | 使用示例:
throw new CaptchaException("CAPTCHA operation failed");
throw new CaptchaException("CAPTCHA operation failed", cause);
// Catchable as OpenException
try { ... } catch (OpenException e) { ... } // catches all OpenCode exceptions
try { ... } catch (CaptchaException e) { ... } // catches only captcha exceptions
Security | 安全性:
- Thread-safe: Yes (immutable after construction) - 线程安全: 是(构造后不可变)
- Null-safe: No (message may be null) - 空值安全: 否(消息可能为空)
- Since:
- JDK 25, opencode-base-captcha V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCaptchaException(String message) Constructs a new exception with the specified message.CaptchaException(String errorCode, String message) Constructs a new exception with message and error code.CaptchaException(String errorCode, String message, Throwable cause) Constructs a new exception with message, error code, and cause.CaptchaException(String message, Throwable cause) Constructs a new exception with the specified message and cause.CaptchaException(Throwable cause) Constructs a new exception with the specified cause. -
Method Summary
Methods inherited from class OpenException
getComponent, getErrorCode, getMessage, getRawMessageMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
CaptchaException
Constructs a new exception with the specified message. 使用指定消息构造新异常。- Parameters:
message- the detail message | 详细消息
-
CaptchaException
-
CaptchaException
Constructs a new exception with the specified cause. 使用指定原因构造新异常。- Parameters:
cause- the cause | 原因
-
CaptchaException
-
CaptchaException
-