1 22 23 package org.xquark.extractor.common; 24 25 public class ChainedException extends RuntimeException { 26 27 private static final String RCSRevision = "$Revision: 1.2 $"; 28 private static final String RCSName = "$Name: $"; 29 30 31 private Throwable cause = null; 32 33 public ChainedException() { 34 super (); 35 } 36 37 public ChainedException (String message) { 38 super(message); 39 } 40 41 public ChainedException(String message, Throwable cause) { 42 super(message); 43 this.cause = cause; 44 } 45 46 public Throwable getCause() { 47 return cause; 48 } 49 50 public void printStackTrace() { 51 super.printStackTrace(); 52 if (cause != null) { 53 System.err.println("Caused by:"); 54 cause.printStackTrace(); 55 } 56 } 57 58 public void printStackTrace(java.io.PrintStream ps) { 59 super.printStackTrace(ps); 60 if (cause != null) { 61 ps.println("Caused by:"); 62 cause.printStackTrace(ps); 63 } 64 } 65 66 public void printStackTrace(java.io.PrintWriter pw) { 67 super.printStackTrace(pw); 68 if (cause != null) { 69 pw.println("Caused by:"); 70 cause.printStackTrace(pw); 71 } 72 } 73 } 74 | Popular Tags |