2 * Copyright 2017 Huawei Technologies Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.onap.vnfsdk.marketplace.db.exception;
19 public class ErrorCodeException extends Exception {
21 private static final long serialVersionUID = 3220072444842529499L;
22 private final int categoryCode;
23 private final int errorCode;
24 private final String[] arguments;
27 public ErrorCodeException(int code, String debugMessage) {
28 this(code, debugMessage, null);
32 * error code exception.
33 * @param code error code
34 * @param debugMessage debug message
35 * @param arguments arguments
37 public ErrorCodeException(int code, String debugMessage, String[] arguments) {
39 this.errorCode = code;
40 this.arguments = arguments;
41 this.categoryCode = 0;
45 public ErrorCodeException(Throwable source, int code) {
46 this(source, code, (String[]) null);
50 * error code exception.
51 * @param source Throwable
52 * @param code error code
53 * @param arguments arguments
55 public ErrorCodeException(Throwable source, int code, String[] arguments) {
57 this.errorCode = code;
58 this.arguments = arguments;
59 this.categoryCode = 0;
63 public ErrorCodeException(Throwable source, int code, String debugMessage) {
64 this(source, code, debugMessage, null);
68 * error code exception.
69 * @param source Throwable
70 * @param code error code
71 * @param debugMessage debug message
72 * @param arguments arguments
74 public ErrorCodeException(Throwable source, int code, String debugMessage, String[] arguments) {
75 super(debugMessage, source);
76 this.errorCode = code;
77 this.arguments = arguments;
78 this.categoryCode = 0;
82 public ErrorCodeException(int category, int code, String debugMessage) {
83 this(category, code, debugMessage, null);
87 public ErrorCodeException(int category, int code, String debugMessage, String[] arguments) {
89 this.categoryCode = category;
90 this.errorCode = code;
91 this.arguments = arguments;
95 public ErrorCodeException(Throwable source, int category, int code) {
96 this(source, category, code, (String[]) null);
100 public ErrorCodeException(Throwable source, int category, int code, String[] arguments) {
102 this.categoryCode = category;
103 this.errorCode = code;
104 this.arguments = arguments;
108 public ErrorCodeException(Throwable source, int category, int code, String debugMessage) {
109 this(source, category, code, debugMessage, null);
113 public ErrorCodeException(Throwable source, int category, int code, String debugMessage,
114 String[] arguments) {
115 super(debugMessage, source);
116 this.categoryCode = category;
117 this.errorCode = code;
118 this.arguments = arguments;
122 public int getCategory() {
126 public int getErrorCode() {
131 public String[] getArguments() {