diff --git a/cola-framework/cola-core/src/main/java/com/alibaba/cola/exception/BasicErrorCode.java b/cola-framework/cola-core/src/main/java/com/alibaba/cola/exception/BasicErrorCode.java index b91f2ed6f..61903dca3 100644 --- a/cola-framework/cola-core/src/main/java/com/alibaba/cola/exception/BasicErrorCode.java +++ b/cola-framework/cola-core/src/main/java/com/alibaba/cola/exception/BasicErrorCode.java @@ -3,11 +3,10 @@ /** * Application Exceptions can be divided into Biz Exception and Sys Exception. * - * BizException (including ParamException) is not retry-able, while Sys Exception could be instantaneous and retry-able. + * Business Exception is not retry-able, while System Exception could be instantaneous and retry-able. * - * So i suggest to define 3 types of ErrorCode, the format is TYPE_SCENARIO_REASON + * So i suggest to define 2 types of ErrorCode, the format is TYPE_SCENARIO_REASON * - * TYPE: P_ Stands for Parameter * TYPE: B_ Stands for Business * TYPE: S_ Stands for System * @@ -19,7 +18,9 @@ public enum BasicErrorCode implements ErrorCodeI{ * Parameter Exception * * You can extend it by implementing ErrorCodeI in your Application - * For example: P_CUSTOMER_NameIsNull("P_CUSTOMER_NameIsNull","客户姓名不能为空") + * For example: + * + * P_CUSTOMER_NameIsNull("P_CUSTOMER_NameIsNull","客户姓名不能为空") */ P_COMMON_ERROR("P_COMMON_ERROR" , "通用的参数校验错误"), @@ -27,7 +28,12 @@ public enum BasicErrorCode implements ErrorCodeI{ * Business Exception * * You can extend it by implementing ErrorCodeI in your Application - * For example: B_CUSTOMER_NameAlreadyExist("B_CUSTOMER_NameAlreadyExist","客户姓名已经存在") + * For example: + * + *
+     * B_CUSTOMER_NameIsNull("B_CUSTOMER_NameIsNull","客户姓名不能为空")
+     * B_CUSTOMER_NameAlreadyExist("B_CUSTOMER_NameAlreadyExist","客户姓名已经存在")
+     * 
*/ B_COMMON_ERROR("B_COMMON_ERROR" , "通用的业务逻辑错误"), diff --git a/cola-framework/cola-core/src/main/java/com/alibaba/cola/exception/DefaultExceptionHandler.java b/cola-framework/cola-core/src/main/java/com/alibaba/cola/exception/DefaultExceptionHandler.java index 77be99831..e8b33f2e2 100644 --- a/cola-framework/cola-core/src/main/java/com/alibaba/cola/exception/DefaultExceptionHandler.java +++ b/cola-framework/cola-core/src/main/java/com/alibaba/cola/exception/DefaultExceptionHandler.java @@ -25,7 +25,7 @@ public void handleException(Command cmd, Response response, Exception exception) private void printLog(Command cmd, Response response, Exception exception) { if(exception instanceof BizException || exception instanceof ParamException){ - //biz exception is expected, only warn it + //biz exception is expected, only warn it, 2 git remote test logger.warn(buildErrorMsg(cmd, response)); } else{