2 * Copyright 2016 [ZTE] and others.
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.openo.commontosca.catalog.db.exception;
23 public class ErrorCodeException extends Exception {
25 private static final long serialVersionUID = 3220072444842529499L;
26 private int categoryCode = 0;
27 private int errorCode = 1;
28 private String[] arguments = null;
30 private static String defaultText = null;
33 public static void setDefaultText(String text) {
38 public static String getDefaultText() {
43 public ErrorCodeException(int code, String debugMessage) {
44 this(code, debugMessage, null);
48 public ErrorCodeException(int code, String debugMessage, String[] arguments) {
50 this.errorCode = code;
51 this.arguments = arguments;
55 public ErrorCodeException(Throwable source, int code) {
56 this(source, code, (String[]) null);
60 public ErrorCodeException(Throwable source, int code, String[] arguments) {
62 this.errorCode = code;
63 this.arguments = arguments;
67 public ErrorCodeException(Throwable source, int code, String debugMessage) {
68 this(source, code, debugMessage, null);
72 public ErrorCodeException(Throwable source, int code, String debugMessage, String[] arguments) {
73 super(debugMessage, source);
74 this.errorCode = code;
75 this.arguments = arguments;
79 public ErrorCodeException(int category, int code, String debugMessage) {
80 this(category, code, debugMessage, null);
84 public ErrorCodeException(int category, int code, String debugMessage, String[] arguments) {
86 this.categoryCode = category;
87 this.errorCode = code;
88 this.arguments = arguments;
92 public ErrorCodeException(Throwable source, int category, int code) {
93 this(source, category, code, (String[]) null);
97 public ErrorCodeException(Throwable source, int category, int code, String[] arguments) {
99 this.categoryCode = category;
100 this.errorCode = code;
101 this.arguments = arguments;
105 public ErrorCodeException(Throwable source, int category, int code, String debugMessage) {
106 this(source, category, code, debugMessage, null);
110 public ErrorCodeException(Throwable source, int category, int code, String debugMessage,
111 String[] arguments) {
112 super(debugMessage, source);
113 this.categoryCode = category;
114 this.errorCode = code;
115 this.arguments = arguments;
119 public int getCategory() {
123 public int getErrorCode() {
128 public String[] getArguments() {