Add new exception class
authoryoubowu <wu.youbo@zte.com.cn>
Sat, 18 Feb 2017 03:25:18 +0000 (11:25 +0800)
committer6092002067 <wu.youbo@zte.com.cn>
Sat, 18 Feb 2017 06:15:31 +0000 (14:15 +0800)
Issue-ID:HOLMES-9

Change-Id: Ib7037b582a1a15b3c6d93daa200b42751268728e
Signed-off-by: youbowu <wu.youbo@zte.com.cn>
holmes-actions/src/main/java/org/openo/holmes/common/exception/CorrelationException.java [moved from holmes-actions/src/main/java/org/openo/holmes/common/exception/CallException.java with 78% similarity]
holmes-actions/src/main/java/org/openo/holmes/common/exception/DataFormatException.java [deleted file]
holmes-actions/src/main/java/org/openo/holmes/common/i18n/correlation-i18n-en-US.json
holmes-actions/src/main/java/org/openo/holmes/common/i18n/correlation-i18n-zh-CN.json
holmes-actions/src/main/java/org/openo/holmes/common/utils/I18nProxy.java

  */\r
 package org.openo.holmes.common.exception;\r
 \r
-public class CallException extends Exception {\r
-    public CallException(String msg, Exception e) {\r
+public class CorrelationException extends Exception {\r
+\r
+    public CorrelationException(String msg, Exception e) {\r
         super(msg, e);\r
     }\r
 \r
-    public CallException(String msg) {\r
+    public CorrelationException(String msg) {\r
         super(msg);\r
     }\r
 }
\ No newline at end of file
diff --git a/holmes-actions/src/main/java/org/openo/holmes/common/exception/DataFormatException.java b/holmes-actions/src/main/java/org/openo/holmes/common/exception/DataFormatException.java
deleted file mode 100644 (file)
index 7fcc3b2..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/**\r
- * Copyright 2017 ZTE Corporation.\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- *     http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.openo.holmes.common.exception;\r
-\r
-public class DataFormatException extends Exception {\r
-    public DataFormatException(String msg, Exception e ) {\r
-        super( msg, e );\r
-    }\r
-\r
-    public DataFormatException(String msg ) {\r
-        super( msg );\r
-    }\r
-}\r
index 9aa6357..9581b40 100644 (file)
@@ -25,5 +25,6 @@
   "RULE_MANAGEMENT_REPEAT_RULE_NAME": "Rule name repetition",\r
   "RULE_MANAGEMENT_RULE_NAME_IS_EMPTY": "Rule name is empty",\r
   "RULE_MANAGEMENT_DATA_FORMAT_ERROR": "Data format error",\r
-  "RULE_MANAGEMENT_PARAMETER_ENABLED_ERROR": "Parameter enabled can only be 0 (not enabled) and 1 (enabled)"\r
+  "RULE_MANAGEMENT_PARAMETER_ENABLED_ERROR": "Parameter enabled can only be 0 (not enabled) and 1 (enabled)",\r
+  "RULE_MANAGEMENT_DB_ERROR": "db error"\r
 }\r
index 9ca28fe..1a59c2f 100644 (file)
@@ -21,5 +21,7 @@
   "RULE_MANAGEMENT_REPEAT_RULE_NAME" : "规则名字重复",\r
   "RULE_MANAGEMENT_RULE_NAME_IS_EMPTY" : "规则名字为空",\r
   "RULE_MANAGEMENT_DATA_FORMAT_ERROR": "数据格式异常",\r
-  "RULE_MANAGEMENT_PARAMETER_ENABLED_ERROR" : "参数enabled只能为0(未启用)和1(启用)"\r
+  "RULE_MANAGEMENT_PARAMETER_ENABLED_ERROR" : "参数enabled只能为0(未启用)和1(启用)",\r
+  "RULE_MANAGEMENT_DB_ERROR" : "数据库异常"\r
+\r
 }\r
index 2eda5da..2c74f03 100644 (file)
@@ -51,6 +51,7 @@ public class I18nProxy {
     public static final String RULE_MANAGEMENT_REPEAT_RULE_NAME = "RULE_MANAGEMENT_REPEAT_RULE_NAME";\r
     public static final String RULE_MANAGEMENT_DATA_FORMAT_ERROR = "RULE_MANAGEMENT_DATA_FORMAT_ERROR";\r
     public static final String RULE_MANAGEMENT_PARAMETER_ENABLED_ERROR = "RULE_MANAGEMENT_PARAMETER_ENABLED_ERROR";\r
+    public static final String RULE_MANAGEMENT_DB_ERROR = "RULE_MANAGEMENT_DB_ERROR";\r
 \r
     private Optional<I18n> optional = null;\r
 \r