01: /*
02: * Copyright 2007 Bastian Schenke Licensed under the Apache License, Version 2.0 (the "License");
03: * you may not use this file except in compliance with the License.
04: * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
05: * Unless required by applicable law or agreed to in writing, software distributed under the
06: * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
07: * either express or implied. See the License for the specific language governing permissions
08: * and limitations under the License.
09: */
10: package nz.org.take.r2ml;
11:
12: import nz.org.take.TakeException;
13:
14: /**
15: * @author Bastian Schenke (bastian.schenke@googlemail.com)
16: *
17: */
18: public class R2MLException extends TakeException {
19:
20: /**
21: *
22: */
23: public static final byte GENERIC_ERROR = 00;
24:
25: /**
26: *
27: */
28: public static final byte FEATURE_NOT_SUPPORTED = 20;
29:
30: /**
31: *
32: */
33: public static final byte FEATURE_NOT_YET_IMPLEMENTED = 25;
34:
35: /**
36: * this error useally occurs when the wrong XmlTypeHandler is loaded.
37: */
38: public static final byte CLASS_CAST_ERROR = 40;
39:
40: /**
41: *
42: */
43: public static final byte NO_TYPE_HANDLER_FOUND = 60;
44:
45: private int errorCode = GENERIC_ERROR;
46:
47: /**
48: * @param msg
49: * @param cause
50: * @param error
51: */
52: public R2MLException(String msg, Exception cause, int error) {
53: super (msg, cause);
54: errorCode = error;
55: }
56:
57: /**
58: * @param msg
59: * @param cause
60: */
61: public R2MLException(String msg, Exception cause) {
62: super (msg, cause);
63: }
64:
65: /**
66: * @param msg
67: * @param error
68: */
69: public R2MLException(String msg, byte error) {
70: super (msg);
71: errorCode = error;
72: }
73:
74: /**
75: * @param msg
76: */
77: public R2MLException(String msg) {
78: super (msg);
79: }
80:
81: /**
82: * @return
83: */
84: public int getErrorCode() {
85: return errorCode;
86: }
87: }
|