public static final String BOOLEAN_FALSE = "false";
// Error message
+ public static final String ERROR= "error";
+ public static final String ERROR_CODE= "code";
+ public static final String ERROR_MESSAGE= "message";
+
public static final String SCHEMA_INVALID_DEFAULT_PARAMS_SECTION = "Invalid default_parameter section";
public static final String SCHEMA_FILE_EMPTY = "The schema file cann't be null or empty";
public static final String SCHEMA_FILE_WRONG_EXTN = "Schema file should be '.yaml' extension";
package org.onap.cli.fw.error;
+import org.onap.cli.fw.conf.OnapCommandConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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);