-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[linkis-module]module errorcode optimization and documentation (#3550)
- Loading branch information
1 parent
9f6d28f
commit 46259eb
Showing
12 changed files
with
153 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
## linkis-module errorcode | ||
|
||
| module name(模块名) | error code(错误码) | describe(描述) |enumeration name(枚举)| Exception Class(类名)| | ||
| -------- | -------- | ----- |-----|-----| | ||
|linkis-module |10010|DataWorkCloud service must set the version, please add property [[wds.linkis.server.version]] to properties file.(DataWorkCloud 服务必须设置版本,请将属性 [[wds.linkis.server.version]] 添加到属性文件.)|DATAWORKCLOUD_MUST_VERSION|LinkisModuleErrorCodeSummary| | ||
|linkis-module |10021|Failed to get user parameters! Reason: RPC request Service failed!(获取用户参数失败!原因:RPC请求服务失败!)|FETCH_MAPCACHE_ERROR|LinkisModuleErrorCodeSummary| | ||
|linkis-module |10050|Application {} is not exists any instances(应用程序 {} 不存在任何实例)|NOT_EXISTS_APPLICATION|LinkisModuleErrorCodeSummary| | ||
|linkis-module |11000|The wds.linkis.server.home或BDP_SERVER_HOME haven't set!(wds.linkis.server.home 或 BDP_SERVER_HOME 没有设置!)|HAVE_NOT_SET|LinkisModuleErrorCodeSummary| | ||
|linkis-module |11001|Verification failed,{} cannot be empty!(验证失败,{} 不能为空!)|VERIFICATION_CANNOT_EMPTY|LinkisModuleErrorCodeSummary| | ||
|linkis-module |11002|Login has expired, please log in again!(登录已过期,请重新登录!)|NOT_LOGGED|LinkisModuleErrorCodeSummary| | ||
|linkis-module |11003|Illegal user token information(非法的用户token信息).|ILLEGAL_USER_TOKEN|LinkisModuleErrorCodeSummary| | ||
|linkis-module |11004|ServerSocket{} does not exist!(ServerSocket{}不存在!)|SERVERSSOCKET_NOT_EXIST|LinkisModuleErrorCodeSummary| | ||
|linkis-module |11005|The receive queue for WebSocket is full, please try again later!(WebSocket的接收队列已满,请稍后重试!)|WEBSOCKET_IS_FULL|LinkisModuleErrorCodeSummary| | ||
|linkis-module |11035|WebSocket consumer has stopped, please contact the administrator to handle!(WebSocket的消费器已停止,请联系管理员处理!)|WEBSOCKET_STOPPED|LinkisModuleErrorCodeSummary| | ||
|
105 changes: 105 additions & 0 deletions
105
...linkis-module/src/main/java/org/apache/linkis/errorcode/LinkisModuleErrorCodeSummary.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.linkis.errorcode; | ||
|
||
public enum LinkisModuleErrorCodeSummary { | ||
DATAWORKCLOUD_MUST_VERSION( | ||
10010, | ||
"DataWorkCloud service must set the version, please add property [[wds.linkis.server.version]] to properties file.(DataWorkCloud 服务必须设置版本,请将属性 [[wds.linkis.server.version]] 添加到属性文件.)", | ||
"DataWorkCloud service must set the version, please add property [[wds.linkis.server.version]] to properties file.(DataWorkCloud 服务必须设置版本,请将属性 [[wds.linkis.server.version]] 添加到属性文件.)"), | ||
FETCH_MAPCACHE_ERROR( | ||
10021, | ||
"Failed to get user parameters! Reason: RPC request Service failed!(获取用户参数失败!原因:RPC请求服务失败!)", | ||
"Failed to get user parameters! Reason: RPC request Service failed!(获取用户参数失败!原因:RPC请求服务失败!)"), | ||
NOT_EXISTS_APPLICATION( | ||
10050, | ||
"Application {} is not exists any instances(应用程序 {} 不存在任何实例)", | ||
"Application {} is not exists any instances(应用程序 {} 不存在任何实例)"), | ||
HAVE_NOT_SET( | ||
11000, | ||
"The wds.linkis.server.home或BDP_SERVER_HOME haven't set!(wds.linkis.server.home 或 BDP_SERVER_HOME 没有设置!)", | ||
"The wds.linkis.server.home或BDP_SERVER_HOME haven't set!(wds.linkis.server.home 或 BDP_SERVER_HOME 没有设置!)"), | ||
VERIFICATION_CANNOT_EMPTY( | ||
11001, | ||
"Verification failed,{} cannot be empty!(验证失败,{} 不能为空!)", | ||
"Verification failed,{} cannot be empty!(验证失败,{}不能为空!)"), | ||
LOGGED_ID(11002, "", ""), | ||
NOT_LOGGED( | ||
11002, | ||
"Login has expired, please log in again!(登录已过期,请重新登录!)", | ||
"Login has expired, please log in again!(登录已过期,请重新登录!)"), | ||
ILLEGAL_ID(11003, "", ""), | ||
ILLEGAL_USER_TOKEN( | ||
11003, | ||
"Illegal user token information(非法的用户token信息).", | ||
"Illegal user token information(非法的用户token信息)."), | ||
SERVERSSOCKET_NOT_EXIST( | ||
11004, | ||
"ServerSocket{} does not exist!(ServerSocket{}不存在!)", | ||
"ServerSocket{} does not exist!(ServerSocket{}不存在!)"), | ||
WEBSOCKET_IS_FULL( | ||
11005, | ||
"The receive queue for WebSocket is full, please try again later!(WebSocket的接收队列已满,请稍后重试!)", | ||
"The receive queue for WebSocket is full, please try again later!(WebSocket的接收队列已满,请稍后重试!)"), | ||
WEBSOCKET_STOPPED( | ||
11035, | ||
"WebSocket consumer has stopped, please contact the administrator to handle!(WebSocket的消费器已停止,请联系管理员处理!)", | ||
"WebSocket consumer has stopped, please contact the administrator to handle!(WebSocket的消费器已停止,请联系管理员处理!)"); | ||
|
||
/** (errorCode)错误码 */ | ||
private int errorCode; | ||
/** (errorDesc)错误描述 */ | ||
private String errorDesc; | ||
/** Possible reasons for the error(错误可能出现的原因) */ | ||
private String comment; | ||
|
||
LinkisModuleErrorCodeSummary(int errorCode, String errorDesc, String comment) { | ||
this.errorCode = errorCode; | ||
this.errorDesc = errorDesc; | ||
this.comment = comment; | ||
} | ||
|
||
public int getErrorCode() { | ||
return errorCode; | ||
} | ||
|
||
public void setErrorCode(int errorCode) { | ||
this.errorCode = errorCode; | ||
} | ||
|
||
public String getErrorDesc() { | ||
return errorDesc; | ||
} | ||
|
||
public void setErrorDesc(String errorDesc) { | ||
this.errorDesc = errorDesc; | ||
} | ||
|
||
public String getComment() { | ||
return comment; | ||
} | ||
|
||
public void setComment(String comment) { | ||
this.comment = comment; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "errorCode: " + this.errorCode + ", errorDesc:" + this.errorDesc; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters