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=========================================================
21 package org.openecomp.sdc.action.errors;
23 import org.openecomp.sdc.action.util.ActionUtil;
26 * Custom Exception class for handling Action Library error scenarios.
28 public class ActionException extends RuntimeException {
30 private String errorCode;
31 private String description;
32 private int logResponseCode;
34 public ActionException() {
39 * Instantiates a new Action exception.
41 * @param errorCode the error code
42 * @param description the description
44 public ActionException(String errorCode, String description) {
45 this.errorCode = errorCode;
46 this.description = description;
47 this.logResponseCode = ActionUtil.getLogResponseCode(this.errorCode);
50 public String getErrorCode() {
54 public void setErrorCode(String errorCode) {
55 this.errorCode = errorCode;
58 public String getDescription() {
62 public void setDescription(String description) {
63 this.description = description;
66 public int getLogResponseCode() {
67 return logResponseCode;
70 public void setLogResponseCode(int logResponseCode) {
71 this.logResponseCode = logResponseCode;