forked from voldemort/voldemort
/
GroupIOException.java
46 lines (32 loc) · 1.02 KB
/
GroupIOException.java
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package voldemort.store.readonly.io;
import java.io.IOException;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
public class GroupIOException extends IOException {
private static final long serialVersionUID = 1L;
List<Throwable> suppressed = new ArrayList<Throwable>();
public GroupIOException(Throwable cause) {
suppressed.add(cause);
}
public void addSuppressedException(Throwable t) {
suppressed.add(t);
}
@Override
public void printStackTrace(PrintStream out) {
for(Throwable current: suppressed) {
current.printStackTrace(out);
}
// this will print ourselves AND the cause...
super.printStackTrace(out);
}
@Override
public void printStackTrace(PrintWriter out) {
for(Throwable current: suppressed) {
current.printStackTrace(out);
}
// this will print ourselves AND the cause...
super.printStackTrace(out);
}
}