[SDC-29] Amdocs OnBoard 1707 initial commit.
[sdc.git] / openecomp-be / lib / openecomp-sdc-action-lib / openecomp-sdc-action-api / src / main / java / org / openecomp / sdc / action / errors / ActionException.java
index fff88d6..08db9e2 100644 (file)
 
 package org.openecomp.sdc.action.errors;
 
+import org.openecomp.sdc.action.util.ActionUtil;
+
+/**
+ * Custom Exception class for handling Action Library error scenarios.
+ */
 public class ActionException extends RuntimeException {
 
   private String errorCode;
   private String description;
+  private int logResponseCode;
 
   public ActionException() {
 
   }
 
+  /**
+   * Instantiates a new Action exception.
+   *
+   * @param errorCode   the error code
+   * @param description the description
+   */
   public ActionException(String errorCode, String description) {
     this.errorCode = errorCode;
     this.description = description;
+    this.logResponseCode = ActionUtil.getLogResponseCode(this.errorCode);
   }
 
   public String getErrorCode() {
@@ -49,4 +62,12 @@ public class ActionException extends RuntimeException {
   public void setDescription(String description) {
     this.description = description;
   }
+
+  public int getLogResponseCode() {
+    return logResponseCode;
+  }
+
+  public void setLogResponseCode(int logResponseCode) {
+    this.logResponseCode = logResponseCode;
+  }
 }