Your browser does not support JavaScript and this site utilizes JavaScript to build content and provide links to additional information. You should either enable JavaScript in your browser settings or use a browser that supports JavaScript in order to take full advantage of this site.
1 4 5 9 10 package org.openlaszlo.utils; 11 12 import java.io.PrintStream ; 13 14 15 public class ChainedException extends RuntimeException  16 { 17 Throwable cause = null; 18 19 23 public ChainedException(String message) { 24 super(message); 25 } 26 27 36 public ChainedException(String message, Throwable cause) { 37 super(cause.getClass().getName() + ": " + message); 38 this.cause = cause; 39 } 40 41 48 public ChainedException(Throwable cause) { 49 super(cause.getClass().getName() + ": " + cause.getMessage()); 50 this.cause = cause; 51 } 52 53 60 public Throwable getCause() { 61 return this.cause; 62 } 63 64 68 public void printStackTrace(PrintStream s) { 69 super.printStackTrace(s); 70 if (cause != null) { 71 s.print("Caused by: "); 72 cause.printStackTrace(s); 73 } 74 } 75 76 80 public void printStackTrace(java.io.PrintWriter pw) { 81 super.printStackTrace(pw); 82 if (cause != null) { 83 pw.println("Caused by:"); 84 cause.printStackTrace(pw); 85 } 86 } 87 } 88
| Popular Tags
|