1 package org.lsst.ccs.utilities.exc;
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 public class BundledException extends Exception implements ThrowableList{
31 ThrowableList previousThrowable ;
32
33 public BundledException(ThrowableList previousThrowable) {
34 this.previousThrowable = previousThrowable;
35 }
36
37 public BundledException(String s, ThrowableList previousThrowable) {
38 super(s);
39 this.previousThrowable = previousThrowable;
40 }
41
42 public BundledException(String s, Throwable throwable, ThrowableList previousThrowable) {
43 super(s, throwable);
44 this.previousThrowable = previousThrowable;
45 }
46
47 public BundledException(Throwable throwable, ThrowableList previousThrowable) {
48 super(throwable);
49 this.previousThrowable = previousThrowable;
50 }
51
52 public Throwable previous() {
53 return (Throwable) this.previousThrowable ;
54 }
55
56 @Override
57 public Throwable current() {
58 return this;
59 }
60
61 public String toString() {
62 return super.toString()+ "\n" + (previousThrowable!=null? previousThrowable.toString():"") ;
63 }
64
65 public void setPreviousThrowable(ThrowableList previousThrowable) {
66 this.previousThrowable = previousThrowable;
67 }
68 }