1 /**
2 * AUTOHIT 2003
3 * Copyright Erich P Gatejen (c) 1989,1997,2003,2004
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or (at
8 * your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Additional license information can be found in the documentation.
19 * @author Erich P Gatejen
20 */
21 package autohit.universe;
22
23 import autohit.common.AutohitException;
24
25 /**
26 * A Universe exception. A numeric error number can be set.
27 * The default is UE_GENERIC.
28 *
29 * @author Erich P. Gatejen
30 * @version 1.0
31 * <i>Version History</i>
32 * <code>EPG - Initial - 16Apr03<br>
33 * EPG - exception chaining - 13Jun03</code>
34 *
35 */
36 public class UniverseException extends AutohitException {
37
38 final static long serialVersionUID = 1;
39
40 /**
41 * UNIVERSE NUMERICS. ALL are ERRORS
42 */
43 public final static int UE_DEFAULT = CODE_UNIVERSE_ERROR;
44 public final static int UE_IO_ERROR = CODE_UNIVERSE_ERROR + 1;
45 public final static int UE_OBJECT_DOESNT_EXIST = CODE_UNIVERSE_ERROR + 2;
46 public final static int UE_CANNOT_STREAM = CODE_UNIVERSE_ERROR + 3;
47 public final static int UE_CORRUPT_UNIVERSE = CODE_UNIVERSE_ERROR + 4;
48 public final static int UE_CORRUPT_OBJECT = CODE_UNIVERSE_ERROR + 5;
49 public final static int UE_HANDLER_ERROR = CODE_UNIVERSE_ERROR + 6;
50 public final static int UE_MALFORMED_REFERENCE = CODE_UNIVERSE_ERROR + 7;
51 public final static int UE_UNIVERSE_DOESNT_EXIST = CODE_UNIVERSE_ERROR + 8;
52 public final static int UE_NAMED_UNIVERSE_SERVICE_DOESNT_EXIST =
53 CODE_UNIVERSE_ERROR + 9;
54 public final static int UE_REQUIRED_PROPERTY_MISSING =
55 CODE_UNIVERSE_ERROR + 10;
56 public final static int UE_NOT_SUPPORTED = CODE_UNIVERSE_ERROR + 11;
57 public final static int UE_OBJECT_LOCKED = CODE_UNIVERSE_ERROR + 12;
58 public final static int UE_DONT_OWN_THE_LOCK = CODE_UNIVERSE_ERROR + 13;
59 public final static int UE_TOP = TOP_CODE_UNIVERSE_ERROR;
60
61 /**
62 * Default Constructor.
63 */
64 public UniverseException() {
65 super("Generic UniverseException", UE_DEFAULT);
66 }
67
68 /**
69 * Message constructor
70 * @param message text message for exception
71 */
72 public UniverseException(String message) {
73 super(message, UE_DEFAULT);
74 }
75
76 /**
77 * Message constructor
78 * @param n numeric error
79 */
80 public UniverseException(int n) {
81 super("Generic UniverseException", n);
82 }
83
84 /**
85 * Message constructor
86 * @param message text message for exception
87 * @param n numeric error
88 */
89 public UniverseException(String message, int n) {
90 super(message, n);
91 }
92
93 /**
94 * Message constructor with cause
95 * @param message text message for exception
96 * @param theCause for exception chaining
97 */
98 public UniverseException(String message, Throwable theCause) {
99 super(message, UE_DEFAULT);
100 }
101
102 /**
103 * Message constructor with cause
104 * @param n numeric error
105 * @param theCause for exception chaining
106 */
107 public UniverseException(int n, Throwable theCause) {
108 super("Generic UniverseException", n);
109 }
110
111 /**
112 * Message constructor with cause
113 * @param message text message for exception
114 * @param n numeric error
115 * @param theCause for exception chaining
116 */
117 public UniverseException(String message, int n, Throwable theCause) {
118 super(message, n, theCause);
119 numeric = n;
120 }
121
122 }
|