Enum Class FeatureErrorCode

java.lang.Object
java.lang.Enum<FeatureErrorCode>
cloud.opencode.base.feature.exception.FeatureErrorCode
All Implemented Interfaces:
Serializable, Comparable<FeatureErrorCode>, Constable

public enum FeatureErrorCode extends Enum<FeatureErrorCode>
Feature Error Code 功能错误码

Error codes for feature-related exceptions.

功能相关异常的错误码。

Code Ranges | 错误码范围:

  • 0 - Unknown errors | 未知错误
  • 1xxx - Feature errors | 功能错误
  • 2xxx - Configuration errors | 配置错误
  • 3xxx - Store errors | 存储错误
  • 4xxx - Security errors | 安全错误

Features | 主要功能:

  • Categorized error codes: general, storage, strategy, security - 分类错误代码:通用、存储、策略、安全
  • Bilingual error messages (English and Chinese) - 双语错误消息

Usage Examples | 使用示例:

FeatureErrorCode value = FeatureErrorCode.values()[0];
// Use in switch or comparisons
// 在switch或比较中使用

Security | 安全性:

  • Thread-safe: Yes (immutable) - 线程安全: 是(不可变)
  • Null-safe: N/A - 空值安全: 不适用
Since:
JDK 25, opencode-base-feature V1.0.0
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Enum Constant Details

  • Method Details

    • values

      public static FeatureErrorCode[] 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

      public static FeatureErrorCode valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getCode

      public int getCode()
      Get error code 获取错误码
      Returns:
      error code | 错误码
    • getMessage

      public String getMessage()
      Get error message 获取错误消息
      Returns:
      error message | 错误消息
    • getMessageZh

      public String getMessageZh()
      Get Chinese error message 获取中文错误消息
      Returns:
      Chinese message | 中文消息
    • getDescription

      public String getDescription()
      Get description (code: message) 获取描述 (code: message)
      Returns:
      description | 描述