summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--framework/src/main/java/org/onap/cli/fw/error/OnapCommandException.java32
1 files changed, 16 insertions, 16 deletions
diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandException.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandException.java
index e83f8574..27de7b7d 100644
--- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandException.java
+++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandException.java
@@ -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;
}