1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.promotego.exceptions;
20
21 import java.io.PrintStream;
22 import java.io.PrintWriter;
23
24 public class NestedException extends RuntimeException
25 {
26 private Exception m_exception;
27
28 private NestedException(Exception e)
29 {
30 m_exception = e;
31 }
32
33 public static NestedException wrap(Exception e)
34 {
35 if (e instanceof NestedException)
36 {
37 return (NestedException)e;
38 }
39 else
40 {
41 return new NestedException(e);
42 }
43 }
44
45 public Throwable fillInStackTrace()
46 {
47
48 return this;
49 }
50
51
52 public Throwable getCause()
53 {
54 return m_exception.getCause();
55 }
56
57 public String getLocalizedMessage()
58 {
59 return m_exception.getLocalizedMessage();
60 }
61
62 public String getMessage()
63 {
64 return m_exception.getMessage();
65 }
66
67 public StackTraceElement[] getStackTrace()
68 {
69 return m_exception.getStackTrace();
70 }
71
72 public Throwable initCause(Throwable cause)
73 {
74 return m_exception.initCause(cause);
75 }
76
77 public void printStackTrace()
78 {
79 m_exception.printStackTrace();
80 }
81
82 public void printStackTrace(PrintStream s)
83 {
84 m_exception.printStackTrace(s);
85 }
86
87 public void printStackTrace(PrintWriter s)
88 {
89 m_exception.printStackTrace(s);
90 }
91
92 public void setStackTrace(StackTraceElement[] stackTrace)
93 {
94 m_exception.setStackTrace(stackTrace);
95 }
96
97 public String toString()
98 {
99 return m_exception.toString();
100 }
101 }