1 package freemarker.template.utility; 2 3 import java.io.PrintStream ; 4 import java.io.PrintWriter ; 5 6 11 public class UndeclaredThrowableException extends RuntimeException 12 { 13 private final Throwable t; 14 15 public UndeclaredThrowableException(Throwable t) 16 { 17 this.t = t; 18 } 19 20 public void printStackTrace() 21 { 22 printStackTrace(System.err); 23 } 24 25 public void printStackTrace(PrintStream ps) 26 { 27 synchronized (ps) 28 { 29 ps.print("Undeclared throwable:"); 30 t.printStackTrace(ps); 31 } 32 } 33 34 public void printStackTrace(PrintWriter pw) 35 { 36 synchronized (pw) 37 { 38 pw.print("Undeclared throwable:"); 39 t.printStackTrace(pw); 40 } 41 } 42 43 public Throwable getUndeclaredThrowable() { 44 return t; 45 } 46 } 47 | Popular Tags |