1 package psl;
2
3 import ensure.Ensure;
4
5
6
7
8 public class DefaultExceptionHandler implements ExceptionHandler {
9
10
11
12 public DefaultExceptionHandler() {
13
14
15
16 }
17
18 @Override
19 public void thrown(DispatcherOp<?> op, Object subscriber, Throwable t,
20 Thread dt) {
21 Ensure.not_null(op, "op == null");
22 Ensure.not_null(subscriber, "subscriber == null");
23 Ensure.not_null(t, "t == null");
24 Ensure.not_null(dt, "dt == null");
25
26
27
28
29
30 t.printStackTrace();
31 }
32
33 @Override
34 public void thrown(Runnable task, Throwable t, Thread dt) {
35 Ensure.not_null(task, "task == null");
36 Ensure.not_null(t, "t == null");
37 Ensure.not_null(dt, "dt == null");
38
39
40
41
42
43 t.printStackTrace();
44 }
45
46 @Override
47 public void thrown(Throwable t) {
48 Ensure.not_null(t, "t == null");
49
50
51
52
53
54 t.printStackTrace();
55 }
56 }