2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
20 package org.openecomp.sdc.action.errors;
22 import org.openecomp.sdc.action.util.ActionUtil;
25 * Custom Exception class for handling Action Library error scenarios.
27 public class ActionException extends RuntimeException {
29 private String errorCode;
30 private String description;
31 private int logResponseCode;
33 public ActionException() {
37 * Instantiates a new Action exception.
39 * @param errorCode the error code
40 * @param description the description
42 public ActionException(String errorCode, String description) {
43 this.errorCode = errorCode;
44 this.description = description;
45 this.logResponseCode = ActionUtil.getLogResponseCode(this.errorCode);
48 public String getErrorCode() {
52 public void setErrorCode(String errorCode) {
53 this.errorCode = errorCode;
56 public String getDescription() {
60 public void setDescription(String description) {
61 this.description = description;
64 public int getLogResponseCode() {
65 return logResponseCode;
68 public void setLogResponseCode(int logResponseCode) {
69 this.logResponseCode = logResponseCode;