-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWeird_Exception.java
More file actions
29 lines (23 loc) · 853 Bytes
/
Weird_Exception.java
File metadata and controls
29 lines (23 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
public class Weird_Exception extends Exception {
//public final String what;
public final Exception e;
Weird_Exception( String message, Exception originalException ) {
super( Weird_Exception.generateMessage(message, originalException) );
this.e = originalException;
}
Weird_Exception( String message ) {
super ( Weird_Exception.generateMessage(message, null) );
this.e = null;
}
Weird_Exception() {
super();
this.e = null;
}
public static String generateMessage( String message, Exception originalException ) {
if ( originalException != null ) {
return "Unrecoverable Error: " + message + ":\n" + originalException.getMessage();
} else {
return "Unrecoverable Error: " + message + ".";
}
}
}