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.server.service;
22
23 import autohit.vm.VMException;
24
25 /**
26 * A Service exception. The specific error is given in the numeric
27 * field.
28 *
29 * @author Erich P. Gatejen
30 * @version 1.0
31 * <i>Version History</i>
32 * <code>EPG - Rewrite - 15Sep03</code>
33 *
34 */
35 public class ServiceException extends VMException {
36
37 final static long serialVersionUID = 1;
38
39 /**
40 * Numeric values for the exception.
41 */
42
43 /**
44 * Default Constructor.
45 */
46 public ServiceException() {
47 super("Generic ServiceException", CODE_SERVICE_GENERIC_ERROR);
48 }
49
50 /**
51 * Message constructor
52 * @param message text message for exception
53 */
54 public ServiceException(String message) {
55 super(message, CODE_SERVICE_GENERIC_ERROR);
56 }
57
58 /**
59 * Message constructor
60 * @param n numeric error
61 */
62 public ServiceException(int n) {
63 super("Generic ServiceException", n);
64 }
65
66 /**
67 * Message constructor
68 * @param message text message for exception
69 * @param n numeric error
70 */
71 public ServiceException(String message, int n) {
72 super(message, n);
73 }
74
75 /**
76 * Message constructor with cause
77 * @param message text message for exception
78 * @param theCause for exception chaining
79 */
80 public ServiceException(String message, Throwable theCause) {
81 super(message, CODE_SERVICE_GENERIC_ERROR);
82 }
83
84 /**
85 * Message constructor with cause
86 * @param n numeric error
87 * @param theCause for exception chaining
88 */
89 public ServiceException(int n, Throwable theCause) {
90 super("Generic ServiceException", n);
91 }
92
93 /**
94 * Message constructor with cause
95 * @param message text message for exception
96 * @param n numeric error
97 * @param theCause for exception chaining
98 */
99 public ServiceException(String message, int n, Throwable theCause) {
100 super(message, n, theCause);
101 numeric = n;
102 }
103 }
|