You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by ca...@apache.org on 2022/10/16 05:17:10 UTC
[incubator-linkis] branch dev-1.3.1-errorcode updated: [linkis-bml-server]module errorcode optimization and documentation (#3576)
This is an automated email from the ASF dual-hosted git repository.
casion pushed a commit to branch dev-1.3.1-errorcode
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git
The following commit(s) were added to refs/heads/dev-1.3.1-errorcode by this push:
new 843ff814f [linkis-bml-server]module errorcode optimization and documentation (#3576)
843ff814f is described below
commit 843ff814f3eab45d8ea9b9e49a98ac45fa64b932
Author: 成彬彬 <10...@users.noreply.github.com>
AuthorDate: Sun Oct 16 13:17:03 2022 +0800
[linkis-bml-server]module errorcode optimization and documentation (#3576)
---
docs/errorcode/linkis-bml-server-errorcode.md | 28 ++++
.../bml/errorcode/BmlServerErrorCodeSummary.java | 154 +++++++++++++++++++++
.../linkis/bml/restful/BmlProjectRestful.java | 4 +-
.../apache/linkis/bml/restful/BmlRestfulApi.java | 32 +++--
.../linkis/bml/common/BmlAuthorityException.scala | 12 +-
.../bml/common/BmlPermissionDeniedException.scala | 7 +-
.../linkis/bml/common/BmlQueryFailException.scala | 4 +-
.../bml/common/BmlResourceExpiredException.scala | 6 +-
.../bml/common/BmlServerParaErrorException.scala | 4 +-
9 files changed, 226 insertions(+), 25 deletions(-)
diff --git a/docs/errorcode/linkis-bml-server-errorcode.md b/docs/errorcode/linkis-bml-server-errorcode.md
new file mode 100644
index 000000000..86e1c7a50
--- /dev/null
+++ b/docs/errorcode/linkis-bml-server-errorcode.md
@@ -0,0 +1,28 @@
+## linkis-bml-server errorcode
+
+| module name(模块名) | error code(错误码) | describe(描述) |enumeration name(枚举)| Exception Class(类名)|
+| -------- | -------- | ----- |-----|-----|
+|linkis-bml-server |60036|Store cannot be accessed without login or expired login(未登录或登录过期,无法访问物料库)|CANNOT_ACCESSED_EXPIRED|BmlServerErrorCodeSummary|
+|linkis-bml-server |60050|The first upload of the resource failed(首次上传资源失败)|FIRST_UPLOAD_FAILED|BmlServerErrorCodeSummary|
+|linkis-bml-server |60051|Failed to update resources(更新资源失败)|FAILED_UPDATE_RESOURCES|BmlServerErrorCodeSummary|
+|linkis-bml-server |70068|Failed to download the resource(下载资源失败)|FAILED_DOWNLOAD_RESOURCE|BmlServerErrorCodeSummary|
+|linkis-bml-server |70068|Sorry, the query for version information failed(抱歉,查询版本信息失败)(下载资源失败)|QUERY_VERSION_FAILED|BmlServerErrorCodeSummary|
+|linkis-bml-server |70068|Failed to get all system resource information(获取系统所有资源信息失败)|FAILED_ALL_INFORMATION|BmlServerErrorCodeSummary|
+|linkis-bml-server |70068| Failed to delete the resource version(删除资源版本失败)|DELETE_VERSION_FAILED|BmlServerErrorCodeSummary|
+|linkis-bml-server |70068|Delete resource operation failed(删除资源操作失败)|DELETE_OPERATION_FAILED|BmlServerErrorCodeSummary|
+|linkis-bml-server |70068|The bulk delete resource operation failed(批量删除资源操作失败)|BULK_DELETE_FAILED|BmlServerErrorCodeSummary|
+|linkis-bml-server |70068|ResourceID :{} is empty, illegal or has been deleted (resourceId:为空,非法或者已被删除!)|RESOURCEID_BEEN_DELETED|BmlServerErrorCodeSummary|
+|linkis-bml-server |70068|version :{} is empty, illegal or has been deleted (version:为空,非法或者已被删除!)|VERSION_BEEN_DELETED|BmlServerErrorCodeSummary|
+|linkis-bml-server |70068|Failed to obtain resource basic information (获取资源基本信息失败)|FAILED_RESOURCE_BASIC|BmlServerErrorCodeSummary|
+|linkis-bml-server |78531| has expired and cannot be downloaded(已经过期,不能下载)|EXPIRED_CANNOT_DOWNLOADED|BmlServerErrorCodeSummary|
+|linkis-bml-server |75569|You do not have permission to download this resource (您没有权限下载此资源)|NOT_HAVE_PERMISSION|BmlServerErrorCodeSummary|
+|linkis-bml-server |75570| {} does not have edit permission on project {}. Upload resource failed ({} 对工程 {} 没有编辑权限, 上传资源失败)|NOT_PROJECT_PERMISSION|BmlServerErrorCodeSummary|
+|linkis-bml-server |78361|If the material has not been uploaded or has been deleted, please call the upload interface first(resourceId:{}之前未上传物料,或物料已被删除,请先调用上传接口.!)|MATERIAL_NOTUPLOADED_DELETED|BmlServerErrorCodeSummary|
+|linkis-bml-server |78361|Bulk deletion of resourceIDS parameters is null(批量删除资源操作传入的resourceIds参数为空)|PARAMETERS_IS_NULL|BmlServerErrorCodeSummary|
+|linkis-bml-server |78361|Bulk deletion of unpassed resourceIDS parameters(批量删除未传入resourceIds参数)|BULK_DELETION_PARAMETERS|BmlServerErrorCodeSummary|
+|linkis-bml-server |78361|You did not pass a valid ResourceID(您未传入有效的resourceId)|NOT_BALID_RESOURCEID|BmlServerErrorCodeSummary|
+|linkis-bml-server |78361|The passed ResourceID or version is illegal or has been deleted(传入的resourceId或version非法,或已删除)|ILLEGAL_OR_DELETED|BmlServerErrorCodeSummary|
+|linkis-bml-server |78361|ResourceID and version are required to delete the specified version(删除指定版本,需要指定resourceId 和 version)|DELETE_SPECIFIED_VERSION|BmlServerErrorCodeSummary|
+|linkis-bml-server |78361|The ResourceID you submitted is invalid (您提交的resourceId无效)|SUBMITTED_INVALID|BmlServerErrorCodeSummary|
+|linkis-bml-server |78361|The basic information of the resource is not passed into the ResourceId parameter or the parameter is illegal(获取资源基本信息未传入resourceId参数或参数非法)|PARAMETER_IS_ILLEGAL|BmlServerErrorCodeSummary|
+
diff --git a/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/java/org/apache/linkis/bml/errorcode/BmlServerErrorCodeSummary.java b/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/java/org/apache/linkis/bml/errorcode/BmlServerErrorCodeSummary.java
new file mode 100644
index 000000000..f2da4c381
--- /dev/null
+++ b/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/java/org/apache/linkis/bml/errorcode/BmlServerErrorCodeSummary.java
@@ -0,0 +1,154 @@
+/*
+ * 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.bml.errorcode;
+
+public enum BmlServerErrorCodeSummary {
+ CANNOT_ACCESSED_EXPIRED(
+ 60036,
+ "Store cannot be accessed without login or expired login(未登录或登录过期,无法访问物料库)",
+ "Store cannot be accessed without login or expired login(未登录或登录过期,无法访问物料库)"),
+ FIRST_UPLOAD_FAILED(
+ 60050,
+ "The first upload of the resource failed(首次上传资源失败)",
+ "The first upload of the resource failed(首次上传资源失败)"),
+ FAILED_UPDATE_RESOURCES(
+ 60051, "Failed to update resources(更新资源失败)", "Failed to update resources(更新资源失败)"),
+ BML_QUERY_FAILEXCEPTION(70068, "", ""),
+ FAILED_DOWNLOAD_RESOURCE(
+ 70068, "Failed to download the resource(下载资源失败)", "Failed to download the resource(下载资源失败)"),
+ QUERY_VERSION_FAILED(
+ 70068,
+ " Sorry, the query for version information failed(抱歉,查询版本信息失败)(下载资源失败)",
+ " Sorry, the query for version information failed(抱歉,查询版本信息失败)(下载资源失败)"),
+ FAILED_ALL_INFORMATION(
+ 70068,
+ "Failed to get all system resource information(获取系统所有资源信息失败)",
+ "Failed to get all system resource information(获取系统所有资源信息失败)"),
+ DELETE_VERSION_FAILED(
+ 70068,
+ " Failed to delete the resource version(删除资源版本失败)",
+ " Failed to delete the resource version(删除资源版本失败)"),
+ DELETE_OPERATION_FAILED(
+ 70068,
+ " Delete resource operation failed(删除资源操作失败)",
+ " Delete resource operation failed(删除资源操作失败)"),
+ BULK_DELETE_FAILED(
+ 70068,
+ "The bulk delete resource operation failed(批量删除资源操作失败)",
+ "The bulk delete resource operation failed(批量删除资源操作失败)"),
+ RESOURCEID_BEEN_DELETED(
+ 70068,
+ "ResourceID :{} is empty, illegal or has been deleted (resourceId:为空,非法或者已被删除!)",
+ "ResourceID :{} is empty, illegal or has been deleted (resourceId:为空,非法或者已被删除!)"),
+ VERSION_BEEN_DELETED(
+ 70068,
+ "version :{} is empty, illegal or has been deleted (version:为空,非法或者已被删除!)",
+ "version :{} is empty, illegal or has been deleted (version:为空,非法或者已被删除!)"),
+ FAILED_RESOURCE_BASIC(
+ 70068,
+ "Failed to obtain resource basic information (获取资源基本信息失败)",
+ "Failed to obtain resource basic information (获取资源基本信息失败)"),
+ EXPIRED_CANNOT_DOWNLOADED(
+ 78531,
+ " has expired and cannot be downloaded(已经过期,不能下载)",
+ " has expired and cannot be downloaded(已经过期,不能下载)"),
+ NOT_HAVE_PERMISSION(
+ 75569,
+ "You do not have permission to download this resource (您没有权限下载此资源)",
+ "You do not have permission to download this resource (您没有权限下载此资源)"),
+ NOT_PROJECT_PERMISSION(
+ 75570,
+ "{} does not have edit permission on project {}. Upload resource failed ({} 对工程 {} 没有编辑权限, 上传资源失败)",
+ "{} does not have edit permission on project {}. Upload resource failed ({} 对工程 {} 没有编辑权限, 上传资源失败)"),
+ BML_SERVER_PARA_ID(78361, "", ""),
+ MATERIAL_NOTUPLOADED_DELETED(
+ 78361,
+ "If the material has not been uploaded or has been deleted, please call the upload interface first(resourceId:{}之前未上传物料,或物料已被删除,请先调用上传接口.!)",
+ "If the material has not been uploaded or has been deleted, please call the upload interface first(resourceId:{}之前未上传物料,或物料已被删除,请先调用上传接口.!)"),
+ PARAMETERS_IS_NULL(
+ 78361,
+ "Bulk deletion of resourceIDS parameters is null(批量删除资源操作传入的resourceIds参数为空)",
+ "Bulk deletion of resourceIDS parameters is null(批量删除资源操作传入的resourceIds参数为空)"),
+ BULK_DELETION_PARAMETERS(
+ 78361,
+ "Bulk deletion of unpassed resourceIDS parameters(批量删除未传入resourceIds参数)",
+ "Bulk deletion of unpassed resourceIDS parameters(批量删除未传入resourceIds参数)"),
+ NOT_BALID_RESOURCEID(
+ 78361,
+ "You did not pass a valid ResourceID(您未传入有效的resourceId)",
+ "You did not pass a valid ResourceID(您未传入有效的resourceId)"),
+ ILLEGAL_OR_DELETED(
+ 78361,
+ "The passed ResourceID or version is illegal or has been deleted(传入的resourceId或version非法,或已删除)",
+ "The passed ResourceID or version is illegal or has been deleted(传入的resourceId或version非法,或已删除)"),
+ DELETE_SPECIFIED_VERSION(
+ 78361,
+ "ResourceID and version are required to delete the specified version(删除指定版本,需要指定resourceId 和 version)",
+ "ResourceID and version are required to delete the specified version(删除指定版本,需要指定resourceId 和 version)"),
+ SUBMITTED_INVALID(
+ 78361,
+ "The ResourceID you submitted is invalid (您提交的resourceId无效)",
+ "The ResourceID you submitted is invalid (您提交的resourceId无效)"),
+
+ PARAMETER_IS_ILLEGAL(
+ 78361,
+ "The basic information of the resource is not passed into the ResourceId parameter or the parameter is illegal(获取资源基本信息未传入resourceId参数或参数非法)",
+ "The basic information of the resource is not passed into the ResourceId parameter or the parameter is illegal(获取资源基本信息未传入resourceId参数或参数非法)");
+
+ /** (errorCode)错误码 */
+ private int errorCode;
+ /** (errorDesc)错误描述 */
+ private String errorDesc;
+ /** Possible reasons for the error(错误可能出现的原因) */
+ private String comment;
+
+ BmlServerErrorCodeSummary(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;
+ }
+}
diff --git a/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/java/org/apache/linkis/bml/restful/BmlProjectRestful.java b/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/java/org/apache/linkis/bml/restful/BmlProjectRestful.java
index 9c9355107..1c5482f08 100644
--- a/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/java/org/apache/linkis/bml/restful/BmlProjectRestful.java
+++ b/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/java/org/apache/linkis/bml/restful/BmlProjectRestful.java
@@ -55,6 +55,8 @@ import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.*;
+import static org.apache.linkis.bml.errorcode.BmlServerErrorCodeSummary.FAILED_DOWNLOAD_RESOURCE;
+
@Api(tags = "bml(bigdata material library) project opreation")
@RequestMapping(path = "/bml")
@RestController
@@ -355,7 +357,7 @@ public class BmlProjectRestful {
resourceId,
version);
downloadModel.setState(1);
- throw new BmlQueryFailException("Failed to download the resource(下载资源失败)");
+ throw new BmlQueryFailException(FAILED_DOWNLOAD_RESOURCE.getErrorDesc());
}
downloadService.addDownloadRecord(downloadModel);
LOGGER.info(
diff --git a/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/java/org/apache/linkis/bml/restful/BmlRestfulApi.java b/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/java/org/apache/linkis/bml/restful/BmlRestfulApi.java
index c06c70c4d..2a377a926 100644
--- a/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/java/org/apache/linkis/bml/restful/BmlRestfulApi.java
+++ b/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/java/org/apache/linkis/bml/restful/BmlRestfulApi.java
@@ -69,6 +69,8 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import static org.apache.linkis.bml.errorcode.BmlServerErrorCodeSummary.*;
+
@Api(tags = "bml(bigdata material library) opreation")
@RequestMapping(path = "/bml")
@RestController
@@ -111,7 +113,7 @@ public class BmlRestfulApi {
user,
resourceId);
throw new BmlServerParaErrorException(
- "The ResourceID you submitted is invalid (您提交的resourceId无效)");
+ SUBMITTED_INVALID.getErrorDesc());
}
Integer current = 0;
@@ -173,7 +175,7 @@ public class BmlRestfulApi {
resourceId,
e);
throw new BmlQueryFailException(
- "Sorry, the query for version information failed(抱歉,查询版本信息失败)");
+ QUERY_VERSION_FAILED.getErrorDesc());
}
return message;
@@ -269,7 +271,7 @@ public class BmlRestfulApi {
system,
e);
throw new BmlQueryFailException(
- "Failed to get all system resource information(获取系统所有资源信息失败)");
+ FAILED_ALL_INFORMATION.getErrorDesc());
}
return message;
@@ -290,7 +292,7 @@ public class BmlRestfulApi {
|| StringUtils.isEmpty(jsonNode.get("resourceId").textValue())
|| StringUtils.isEmpty(jsonNode.get("version").textValue())) {
throw new BmlServerParaErrorException(
- "ResourceID and version are required to delete the specified version(删除指定版本,需要指定resourceId 和 version)");
+ DELETE_SPECIFIED_VERSION.getErrorDesc());
}
String resourceId = jsonNode.get("resourceId").textValue();
@@ -300,7 +302,7 @@ public class BmlRestfulApi {
|| !versionService.checkVersion(resourceId, version)
|| !versionService.canAccess(resourceId, version)) {
throw new BmlServerParaErrorException(
- "The passed ResourceID or version is illegal or has been deleted(传入的resourceId或version非法,或已删除)");
+ ILLEGAL_OR_DELETED.getErrorDesc());
}
Message message = null;
ResourceTask resourceTask =
@@ -356,7 +358,7 @@ public class BmlRestfulApi {
resourceTask.getId(),
resourceTask.getResourceId(),
TaskState.SUCCESS.getValue());
- throw new BmlQueryFailException("Failed to delete the resource version(删除资源版本失败)");
+ throw new BmlQueryFailException(DELETE_VERSION_FAILED.getErrorDesc());
}
return message;
}
@@ -374,7 +376,7 @@ public class BmlRestfulApi {
if (null == jsonNode.get("resourceId")) {
throw new BmlServerParaErrorException(
- "You did not pass a valid ResourceID(您未传入有效的resourceId)");
+ NOT_BALID_RESOURCEID.getErrorDesc());
}
String resourceId = jsonNode.get("resourceId").textValue();
@@ -435,7 +437,7 @@ public class BmlRestfulApi {
resourceTask.getId(),
resourceTask.getResourceId(),
TaskState.FAILED.getValue());
- throw new BmlQueryFailException("Delete resource operation failed(删除资源操作失败)");
+ throw new BmlQueryFailException(DELETE_OPERATION_FAILED.getErrorDesc());
}
return message;
@@ -454,7 +456,7 @@ public class BmlRestfulApi {
if (null == jsonNode.get("resourceIds")) {
throw new BmlServerParaErrorException(
- "Bulk deletion of unpassed resourceIDS parameters(批量删除未传入resourceIds参数)");
+ BULK_DELETION_PARAMETERS.getErrorDesc());
}
Iterator<JsonNode> jsonNodeIter = jsonNode.get("resourceIds").elements();
@@ -464,7 +466,7 @@ public class BmlRestfulApi {
if (0 == resourceIds.size()) {
throw new BmlServerParaErrorException(
- "Bulk deletion of resourceIDS parameters is null(批量删除资源操作传入的resourceIds参数为空)");
+ PARAMETERS_IS_NULL.getErrorDesc());
} else {
for (String resourceId : resourceIds) {
if (StringUtils.isBlank(resourceId)
@@ -517,7 +519,7 @@ public class BmlRestfulApi {
resourceTask.getResourceId(),
TaskState.FAILED.getValue());
throw new BmlQueryFailException(
- "The bulk delete resource operation failed(批量删除资源操作失败)");
+ BULK_DELETE_FAILED.getErrorDesc());
}
return message;
}
@@ -558,7 +560,7 @@ public class BmlRestfulApi {
if (!resourceService.checkAuthority(user, resourceId)) {
throw new BmlPermissionDeniedException(
- "You do not have permission to download this resource (您没有权限下载此资源)");
+ NOT_HAVE_PERMISSION.getErrorDesc());
}
// version is null get NewestVersion
if (StringUtils.isBlank(version)) {
@@ -602,7 +604,7 @@ public class BmlRestfulApi {
resourceId,
version);
downloadModel.setState(1);
- throw new BmlQueryFailException("Failed to download the resource(下载资源失败)");
+ throw new BmlQueryFailException(FAILED_DOWNLOAD_RESOURCE.getErrorDesc());
}
downloadService.addDownloadRecord(downloadModel);
logger.info(
@@ -802,7 +804,7 @@ public class BmlRestfulApi {
if (StringUtils.isEmpty(resourceId) || !resourceService.checkResourceId(resourceId)) {
throw new BmlServerParaErrorException(
- "The basic information of the resource is not passed into the ResourceId parameter or the parameter is illegal(获取资源基本信息未传入resourceId参数或参数非法)");
+ PARAMETER_IS_ILLEGAL.getErrorDesc());
}
Message message = null;
@@ -856,7 +858,7 @@ public class BmlRestfulApi {
} catch (final Exception e) {
logger.error("用户 {} 获取 {} 资源信息失败", user, resourceId, e);
throw new BmlQueryFailException(
- "Failed to obtain resource basic information (获取资源基本信息失败)");
+ FAILED_RESOURCE_BASIC.getErrorDesc());
}
return message;
diff --git a/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/scala/org/apache/linkis/bml/common/BmlAuthorityException.scala b/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/scala/org/apache/linkis/bml/common/BmlAuthorityException.scala
index 9d750a087..613ed9441 100644
--- a/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/scala/org/apache/linkis/bml/common/BmlAuthorityException.scala
+++ b/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/scala/org/apache/linkis/bml/common/BmlAuthorityException.scala
@@ -17,16 +17,20 @@
package org.apache.linkis.bml.common
+import org.apache.linkis.bml.errorcode.BmlServerErrorCodeSummary._
import org.apache.linkis.common.exception.ErrorException
case class BmlAuthorityException()
extends ErrorException(
- 60036,
- "Store cannot be accessed without login or expired login(未登录或登录过期,无法访问物料库)"
+ CANNOT_ACCESSED_EXPIRED.getErrorCode,
+ CANNOT_ACCESSED_EXPIRED.getErrorDesc
)
case class UploadResourceException()
- extends ErrorException(60050, "The first upload of the resource failed(首次上传资源失败)")
+ extends ErrorException(FIRST_UPLOAD_FAILED.getErrorCode, FIRST_UPLOAD_FAILED.getErrorDesc)
case class UpdateResourceException()
- extends ErrorException(60051, "Failed to update resources(更新资源失败)")
+ extends ErrorException(
+ FAILED_UPDATE_RESOURCES.getErrorCode,
+ FAILED_UPDATE_RESOURCES.getErrorDesc
+ )
diff --git a/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/scala/org/apache/linkis/bml/common/BmlPermissionDeniedException.scala b/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/scala/org/apache/linkis/bml/common/BmlPermissionDeniedException.scala
index 01184d68b..d139f1123 100644
--- a/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/scala/org/apache/linkis/bml/common/BmlPermissionDeniedException.scala
+++ b/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/scala/org/apache/linkis/bml/common/BmlPermissionDeniedException.scala
@@ -17,8 +17,11 @@
package org.apache.linkis.bml.common
+import org.apache.linkis.bml.errorcode.BmlServerErrorCodeSummary._
import org.apache.linkis.common.exception.ErrorException
-case class BmlPermissionDeniedException(errorMsg: String) extends ErrorException(75569, errorMsg)
+case class BmlPermissionDeniedException(errorMsg: String)
+ extends ErrorException(NOT_HAVE_PERMISSION.getErrorCode, errorMsg)
-case class BmlProjectNoEditException(errorMsg: String) extends ErrorException(75570, errorMsg);
+case class BmlProjectNoEditException(errorMsg: String)
+ extends ErrorException(NOT_PROJECT_PERMISSION.getErrorCode, errorMsg);
diff --git a/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/scala/org/apache/linkis/bml/common/BmlQueryFailException.scala b/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/scala/org/apache/linkis/bml/common/BmlQueryFailException.scala
index 69e9acf7e..bb0b597a1 100644
--- a/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/scala/org/apache/linkis/bml/common/BmlQueryFailException.scala
+++ b/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/scala/org/apache/linkis/bml/common/BmlQueryFailException.scala
@@ -17,6 +17,8 @@
package org.apache.linkis.bml.common
+import org.apache.linkis.bml.errorcode.BmlServerErrorCodeSummary._
import org.apache.linkis.common.exception.ErrorException
-case class BmlQueryFailException(errorMsg: String) extends ErrorException(70068, errorMsg)
+case class BmlQueryFailException(errorMsg: String)
+ extends ErrorException(BML_QUERY_FAILEXCEPTION.getErrorCode, errorMsg)
diff --git a/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/scala/org/apache/linkis/bml/common/BmlResourceExpiredException.scala b/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/scala/org/apache/linkis/bml/common/BmlResourceExpiredException.scala
index 097aee8fe..58569a5df 100644
--- a/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/scala/org/apache/linkis/bml/common/BmlResourceExpiredException.scala
+++ b/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/scala/org/apache/linkis/bml/common/BmlResourceExpiredException.scala
@@ -17,7 +17,11 @@
package org.apache.linkis.bml.common
+import org.apache.linkis.bml.errorcode.BmlServerErrorCodeSummary._
import org.apache.linkis.common.exception.ErrorException
case class BmlResourceExpiredException(resourceId: String)
- extends ErrorException(78531, resourceId + " has expired and cannot be downloaded(已经过期,不能下载)")
+ extends ErrorException(
+ EXPIRED_CANNOT_DOWNLOADED.getErrorCode,
+ resourceId + EXPIRED_CANNOT_DOWNLOADED.getErrorDesc
+ )
diff --git a/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/scala/org/apache/linkis/bml/common/BmlServerParaErrorException.scala b/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/scala/org/apache/linkis/bml/common/BmlServerParaErrorException.scala
index 7bbb5f475..6829148af 100644
--- a/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/scala/org/apache/linkis/bml/common/BmlServerParaErrorException.scala
+++ b/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/scala/org/apache/linkis/bml/common/BmlServerParaErrorException.scala
@@ -17,6 +17,8 @@
package org.apache.linkis.bml.common
+import org.apache.linkis.bml.errorcode.BmlServerErrorCodeSummary._
import org.apache.linkis.common.exception.ErrorException
-case class BmlServerParaErrorException(errorMsg: String) extends ErrorException(78361, errorMsg)
+case class BmlServerParaErrorException(errorMsg: String)
+ extends ErrorException(BML_SERVER_PARA_ID.getErrorCode, errorMsg)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org