00001 package cedar.jetweb; 00002 00003 import java.io.PrintStream; 00004 import java.io.PrintWriter; 00005 import java.sql.SQLException; 00014 public class JetWebException extends Exception { 00015 00016 protected String data = ""; 00017 protected Exception originalException; 00023 public JetWebException(Exception originalException){ 00024 super(originalException.getMessage()); 00025 this.originalException = originalException; 00026 } 00033 public JetWebException(Exception originalException, String msg){ 00034 super(msg +" "+ originalException.getMessage()); 00035 this.originalException = originalException; 00036 } 00043 public JetWebException(String message, String datain){ 00044 super(message); 00045 this.data = datain; 00046 } 00047 00054 public void printStackTrace(PrintWriter s){ 00055 if (originalException!=null){ 00056 originalException.printStackTrace(s); 00057 } else { 00058 super.printStackTrace(s); 00059 } 00060 } 00067 public void printStackTrace(PrintStream s){ 00068 if (originalException!=null){ 00069 originalException.printStackTrace(s); 00070 } else { 00071 super.printStackTrace(s); 00072 } 00073 } 00080 public String getMessage(){ 00081 00082 StringBuffer b = new StringBuffer(); 00083 b.append(this.getClass().getName()); 00084 b.append("\n"); 00085 b.append(super.getMessage()); 00086 00087 if (originalException!=null){ 00088 b.append("\n Original Exception\n"); 00089 b.append(originalException.getClass().getName()); 00090 } 00091 00092 //printStackTrace(System.out); 00093 00094 if (!data.equals("")){ 00095 b.append("\n:DATA:"); 00096 b.append(data); 00097 } 00098 00099 return b.toString(); 00100 00101 } 00107 public Exception getOriginalException(){ 00108 return originalException; 00109 } 00110 00111 } 00112 00113 00114 00115 00116 00117 00118 00119 00120 00121 00122 00123 00124
Generated Wed Jan 17 09:14:27 GMT 2007