diff options
author | Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com> | 2018-04-25 12:30:52 +0530 |
---|---|---|
committer | Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com> | 2018-04-25 13:25:25 +0530 |
commit | 734a8fd191953cefc30d6c94273ead9d4cd84846 (patch) | |
tree | f26b00e7118388aa6a20a0dec80aaf99df8522f6 /framework/src/main | |
parent | 4be5701ee1857037ab42bcfc84d9af48d9ae36bf (diff) |
Following guideline while placing the constructor
Issue-ID: CLI-100
Change-Id: I29980de174127f21f52b46dee0369bb7c43ba4da
Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'framework/src/main')
-rw-r--r-- | framework/src/main/java/org/onap/cli/fw/error/OnapCommandException.java | 32 |
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; } |