|
20 | 20 | */ |
21 | 21 | package org.fugerit.java.core.cfg; |
22 | 22 |
|
| 23 | +import org.fugerit.java.core.lang.ex.CodeException; |
| 24 | + |
23 | 25 | /** |
24 | 26 | * <p>Exception for handling unexpected situations during configuration.</p> |
25 | 27 | * |
|
28 | 30 | * @author Fugerit |
29 | 31 | * |
30 | 32 | */ |
31 | | -public class ConfigException extends Exception { |
| 33 | +public class ConfigException extends CodeException { |
32 | 34 |
|
33 | 35 | /** |
34 | | - * <p>Default value for the code field in a ConfigException.</p> |
| 36 | + * |
35 | 37 | */ |
36 | | - public static final int DEFAULT_CODE = -1; |
| 38 | + private static final long serialVersionUID = -6673695755101705239L; |
37 | 39 |
|
38 | | - private int code = DEFAULT_CODE; |
39 | | - |
40 | | - /* |
41 | | - * |
| 40 | + /** |
| 41 | + * <p>Default value for the code field in a ConfigException.</p> |
42 | 42 | */ |
43 | | - private static final long serialVersionUID = -4205246051306630691L; |
| 43 | + public static final int DEFAULT_CODE = CodeException.DEFAULT_CODE; |
44 | 44 |
|
45 | 45 | public ConfigException() { |
46 | 46 | super(); |
47 | 47 | } |
48 | 48 |
|
49 | | - public ConfigException(String message, Throwable cause) { |
50 | | - super(message, cause); |
| 49 | + public ConfigException(int code) { |
| 50 | + super(code); |
51 | 51 | } |
52 | 52 |
|
53 | | - public ConfigException(String message) { |
54 | | - super(message); |
| 53 | + public ConfigException(String message, int code) { |
| 54 | + super(message, code); |
55 | 55 | } |
56 | 56 |
|
57 | | - public ConfigException(Throwable cause) { |
58 | | - super(cause); |
| 57 | + public ConfigException(String message, Throwable cause, int code) { |
| 58 | + super(message, cause, code); |
59 | 59 | } |
60 | 60 |
|
61 | | - public ConfigException(int code) { |
62 | | - super(); |
63 | | - this.code = code; |
| 61 | + public ConfigException(String message, Throwable cause) { |
| 62 | + super(message, cause); |
64 | 63 | } |
65 | 64 |
|
66 | | - public ConfigException(String message, int code) { |
| 65 | + public ConfigException(String message) { |
67 | 66 | super(message); |
68 | | - this.code = code; |
69 | 67 | } |
70 | 68 |
|
71 | 69 | public ConfigException(Throwable cause, int code) { |
72 | | - super(cause); |
73 | | - this.code = code; |
| 70 | + super(cause, code); |
74 | 71 | } |
75 | 72 |
|
76 | | - public ConfigException(String message, Throwable cause, int code) { |
77 | | - super(message, cause); |
78 | | - this.code = code; |
| 73 | + public ConfigException(Throwable cause) { |
| 74 | + super(cause); |
79 | 75 | } |
80 | 76 |
|
81 | | - /** |
82 | | - * @return the code |
83 | | - */ |
84 | | - public int getCode() { |
85 | | - return code; |
86 | | - } |
87 | | - |
88 | | - /** |
89 | | - * @param code the code to set |
90 | | - */ |
91 | | - public void setCode(int code) { |
92 | | - this.code = code; |
93 | | - } |
94 | | - |
95 | | - /* |
96 | | - * (non-Javadoc) |
97 | | - * @see java.lang.Throwable#toString() |
98 | | - */ |
99 | | - @Override |
100 | | - public String toString() { |
101 | | - return super.toString()+"[code:"+this.code+"]"; |
102 | | - } |
103 | | - |
104 | 77 | } |
0 commit comments