Enum Class EventErrorCode
- All Implemented Interfaces:
Serializable, Comparable<EventErrorCode>, Constable
Event Error Code Enumeration
事件错误码枚举
Defines all error codes for event operations.
定义所有事件操作的错误码。
Error Code Ranges | 错误码范围:
- 0 - Unknown error - 未知错误
- 1xxx - Publish errors - 发布错误
- 2xxx - Listener errors - 监听器错误
- 3xxx - Store errors - 存储错误
- 4xxx - Security errors - 安全错误
Features | 主要功能:
- Categorized error codes - 分类错误码
- Bilingual descriptions - 双语描述
Usage Examples | 使用示例:
EventErrorCode code = EventErrorCode.LISTENER_ERROR;
System.out.println(code.getCode() + ": " + code.getDescription());
Security | 安全性:
- Thread-safe: Yes (immutable) - 线程安全: 是(不可变)
- Since:
- JDK 25, opencode-base-event V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDuplicate listener - 重复注册Event cancelled - 事件被取消Invalid listener method - 无效的监听器方法Listener error - 监听器错误Persist failed - 持久化失败Publish failed - 发布失败Rate limited - 频率超限Registration failed - 注册失败Replay failed - 重放失败Security violation - 安全违规Store error - 存储错误Timeout - 超时Unknown error - 未知错误Verification failed - 验证失败 -
Method Summary
Modifier and TypeMethodDescriptionstatic EventErrorCodeGet error code from exception 从异常获取错误码intgetCode()Get error code number 获取错误码数字Get error description in English 获取英文错误描述Get error description in Chinese 获取中文错误描述static EventErrorCodeReturns the enum constant of this class with the specified name.static EventErrorCode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
UNKNOWN
Unknown error - 未知错误 -
PUBLISH_FAILED
Publish failed - 发布失败 -
EVENT_CANCELLED
Event cancelled - 事件被取消 -
TIMEOUT
Timeout - 超时 -
LISTENER_ERROR
Listener error - 监听器错误 -
REGISTRATION_FAILED
Registration failed - 注册失败 -
DUPLICATE_LISTENER
Duplicate listener - 重复注册 -
INVALID_LISTENER_METHOD
Invalid listener method - 无效的监听器方法 -
STORE_ERROR
Store error - 存储错误 -
PERSIST_FAILED
Persist failed - 持久化失败 -
REPLAY_FAILED
Replay failed - 重放失败 -
VERIFICATION_FAILED
Verification failed - 验证失败 -
RATE_LIMITED
Rate limited - 频率超限 -
SECURITY_VIOLATION
Security violation - 安全违规
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getCode
public int getCode()Get error code number 获取错误码数字- Returns:
- the error code | 错误码
-
getDescription
Get error description in English 获取英文错误描述- Returns:
- the description | 描述
-
getDescriptionCn
Get error description in Chinese 获取中文错误描述- Returns:
- the description in Chinese | 中文描述
-
fromException
Get error code from exception 从异常获取错误码- Parameters:
e- the exception | 异常- Returns:
- the error code | 错误码
-