Class FeatureException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
cloud.opencode.base.core.exception.OpenException
cloud.opencode.base.feature.exception.FeatureException
- All Implemented Interfaces:
OpenExceptionMeta, Serializable
- Direct Known Subclasses:
FeatureConfigException, FeatureExpiredException, FeatureNotFoundException, FeatureSecurityException, FeatureStoreException
Feature Exception Base Class
功能异常基类
Base exception class for all feature-related errors.
所有功能相关错误的基类异常。
Features | 主要功能:
- Error code support - 错误码支持
- Feature key context - 功能键上下文
- Extends OpenException for unified exception handling - 扩展OpenException以统一异常处理
Usage Examples | 使用示例:
try {
OpenFeature.getInstance().get("unknown");
} catch (FeatureException e) {
log.error("Feature error: code={}, message={}",
e.getFeatureErrorCode().getCode(), e.getMessage());
}
Security | 安全性:
- Thread-safe: Yes (immutable) - 线程安全: 是(不可变)
- Null-safe: Partial (validates inputs) - 空值安全: 部分(验证输入)
- Since:
- JDK 25, opencode-base-feature V1.0.3
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionFeatureException(String message) Create exception with message 使用消息创建异常FeatureException(String message, FeatureErrorCode errorCode) Create exception with message and error code 使用消息和错误码创建异常FeatureException(String message, Throwable cause) Create exception with message and cause 使用消息和原因创建异常FeatureException(String message, Throwable cause, String featureKey, FeatureErrorCode errorCode) Create exception with all parameters 使用所有参数创建异常 -
Method Summary
Modifier and TypeMethodDescriptionGet the feature error code 获取功能错误码Get the feature key 获取功能键Methods inherited from class OpenException
getComponent, getErrorCode, getMessage, getRawMessageMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface OpenExceptionMeta
getMetaPrefix
-
Constructor Details
-
FeatureException
Create exception with message 使用消息创建异常- Parameters:
message- the error message | 错误消息
-
FeatureException
-
FeatureException
Create exception with message and error code 使用消息和错误码创建异常- Parameters:
message- the error message | 错误消息errorCode- the error code | 错误码
-
FeatureException
public FeatureException(String message, Throwable cause, String featureKey, FeatureErrorCode errorCode) Create exception with all parameters 使用所有参数创建异常- Parameters:
message- the error message | 错误消息cause- the cause | 原因featureKey- the feature key | 功能键errorCode- the error code | 错误码
-
-
Method Details
-
getFeatureKey
-
getFeatureErrorCode
Get the feature error code 获取功能错误码- Returns:
- error code | 错误码
-