public enum BaseErrorCode extends Enum<BaseErrorCode> implements ErrorCode
参考:
https://developer.mozilla.org/zh-CN/docs/Web/HTTP/Status
| 枚举常量和说明 |
|---|
PARAMETER_ERROR
参数错误
|
PERMISSION_DENIED
权限不足
|
REMOTE_SERVICE_ERROR
远程服务错误
|
REQUEST_METHOD_NOT_ALLOWED
请求的方法不对
|
REQUEST_URI_NOT_FOUND
请求的链接/接口不存在
|
RESOURCE_CONFLICT
资源冲突
|
RESOURCE_NOT_ACCEPTABLE
资源内容无法匹配
|
SERVICE_UNAVAILABLE
系统无法访问(请求接口超过调用频率限制等)
|
SYSTEM_ERROR
系统错误
|
TOO_MANY_REQUESTS
表示在一定的时间内用户发送了太多的请求,即超出了“频次限制”
|
UNSUPPORTED_MEDIA_TYPE
不支持的mediaType
|
| 限定符和类型 | 方法和说明 |
|---|---|
String |
getCode()
错误代码。
|
String |
getMessage()
用户显示给用户的信息。
|
int |
getStatus()
状态码
|
static BaseErrorCode |
valueOf(String name)
返回带有指定名称的该类型的枚举常量。
|
static BaseErrorCode[] |
values()
按照声明该枚举类型的常量的顺序, 返回
包含这些常量的数组。
|
public static final BaseErrorCode REQUEST_URI_NOT_FOUND
public static final BaseErrorCode PARAMETER_ERROR
public static final BaseErrorCode PERMISSION_DENIED
public static final BaseErrorCode REQUEST_METHOD_NOT_ALLOWED
public static final BaseErrorCode RESOURCE_NOT_ACCEPTABLE
public static final BaseErrorCode RESOURCE_CONFLICT
public static final BaseErrorCode UNSUPPORTED_MEDIA_TYPE
public static final BaseErrorCode TOO_MANY_REQUESTS
public static final BaseErrorCode SYSTEM_ERROR
public static final BaseErrorCode REMOTE_SERVICE_ERROR
public static final BaseErrorCode SERVICE_UNAVAILABLE
public static BaseErrorCode[] values()
for (BaseErrorCode c : BaseErrorCode.values()) System.out.println(c);
public static BaseErrorCode valueOf(String name)
name - 要返回的枚举常量的名称。IllegalArgumentException - 如果该枚举类型没有带有指定名称的常量NullPointerException - 如果参数为空值public String getMessage()
ErrorCodegetMessage 在接口中 ErrorCodeCopyright © 2020. All rights reserved.