01: /* ExceptionInOzoneObjectException.java
02: */
03:
04: package org.ozoneDB;
05:
06: import java.io.PrintStream;
07:
08: /**
09: represents an exception which was thrown within a method of an OzoneObject.
10:
11: @author <a href="http://www.medium.net/">Medium.net</a>
12: */
13: public class ExceptionInOzoneObjectException extends RuntimeException
14: implements java.io.Serializable {
15:
16: protected Throwable cause;
17:
18: public ExceptionInOzoneObjectException(String message,
19: Throwable cause) {
20: super (message);
21: this .cause = cause;
22: }
23:
24: public Throwable getCause() {
25: return cause;
26: }
27:
28: public void printStackTrace(PrintStream s) {
29: Throwable cause = getCause();
30:
31: if (cause != null) {
32: originalPrintStackTrace(s);
33: s.println("---");
34: cause.printStackTrace(s);
35: } else {
36: originalPrintStackTrace(s);
37: }
38: }
39:
40: public void originalPrintStackTrace(PrintStream s) {
41: super.printStackTrace(s);
42: }
43: }
|