Following guideline while placing the constructor 07/44607/1
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Wed, 25 Apr 2018 07:00:52 +0000 (12:30 +0530)
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Wed, 25 Apr 2018 07:55:25 +0000 (13:25 +0530)
Issue-ID: CLI-100

Change-Id: I29980de174127f21f52b46dee0369bb7c43ba4da
Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
framework/src/main/java/org/onap/cli/fw/error/OnapCommandException.java

index e83f857..27de7b7 100644 (file)
@@ -80,22 +80,6 @@ public class OnapCommandException extends Exception {
         this(errorCode, errorMessage, -1);
     }
 
-    @Override
-    public String getMessage() {
-        String message =  this.errorCode + "::" + this.errorMessage;
-        if (this.httpStatusCode != -1) {
-            message = this.httpStatusCode + "::" + message;
-        }
-
-        return message;
-    }
-
-    public String toJsonString() {
-        return "{\""+ OnapCommandConstants.ERROR + "\": {\""+
-                OnapCommandConstants.ERROR_CODE + "\": \"" + this.errorCode + "\", \""+
-                OnapCommandConstants.ERROR_MESSAGE + "\": \"" + this.errorMessage + "\"}}";
-    }
-
     public OnapCommandException(String errorCode, String errorMessage, Throwable e) {
         this(errorCode, errorMessage + ", " + e.getMessage());
         log.error(this.getMessage(), e);
@@ -116,6 +100,22 @@ public class OnapCommandException extends Exception {
         log.error(this.getMessage(), e);
     }
 
+    @Override
+    public String getMessage() {
+        String message =  this.errorCode + "::" + this.errorMessage;
+        if (this.httpStatusCode != -1) {
+            message = this.httpStatusCode + "::" + message;
+        }
+
+        return message;
+    }
+
+    public String toJsonString() {
+        return "{\""+ OnapCommandConstants.ERROR + "\": {\""+
+                OnapCommandConstants.ERROR_CODE + "\": \"" + this.errorCode + "\", \""+
+                OnapCommandConstants.ERROR_MESSAGE + "\": \"" + this.errorMessage + "\"}}";
+    }
+
     public String getErrorCode() {
         return this.errorCode;
     }