Enum Class CommonErrorCode

java.lang.Object
java.lang.Enum<CommonErrorCode>
io.github.xezzon.zeroweb.common.exception.CommonErrorCode
All Implemented Interfaces:
IErrorCode, Serializable, Comparable<CommonErrorCode>, Constable

public enum CommonErrorCode extends Enum<CommonErrorCode> implements IErrorCode
错误码分配中心
Author:
xezzon
  • Enum Constant Details

    • UNKNOWN

      public static final CommonErrorCode UNKNOWN
    • REPEAT_DATA

      public static final CommonErrorCode REPEAT_DATA
      唯一键冲突 消息参数0: 重复的键名
    • ARGUMENT_NOT_VALID

      public static final CommonErrorCode ARGUMENT_NOT_VALID
      HTTP请求参数不符合校验规则
    • NO_SUCH_DATA

      public static final CommonErrorCode NO_SUCH_DATA
      数据不存在或已删除
    • NOT_FOUND

      public static final CommonErrorCode NOT_FOUND
      资源不存在
    • NOT_LOGIN

      public static final CommonErrorCode NOT_LOGIN
      未登录
    • INVALID_TOKEN

      public static final CommonErrorCode INVALID_TOKEN
      无效的token
    • DATA_PERMISSION_FORBIDDEN

      public static final CommonErrorCode DATA_PERMISSION_FORBIDDEN
      数据权限无效
  • Method Details

    • values

      public static CommonErrorCode[] 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 CommonErrorCode 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
    • mapping

      public static IErrorCode mapping(Class<? extends Throwable> exceptionClass)
    • sourceType

      public ErrorSourceType sourceType()
      Specified by:
      sourceType in interface IErrorCode
      Returns:
      错误来源类型
    • moduleCode

      public byte moduleCode()
      Description copied from interface: IErrorCode
      模块编码 0 为公共模块 ZeroWeb 的模块编码从 -1~-128 分配 1~127 由使用者分配
      Specified by:
      moduleCode in interface IErrorCode
      Returns:
      模块编码