1 16 17 package org.apache.taglibs.xtags.util; 18 19 import java.io.PrintStream ; 20 import java.io.PrintWriter ; 21 22 37 38 public class NestedRuntimeException extends RuntimeException { 39 40 private Exception nestedException; 41 42 public NestedRuntimeException( Exception nestedException ) { 44 super( nestedException.getMessage() ); 45 this.nestedException = nestedException; 46 } 47 48 public NestedRuntimeException( String message, Exception nestedException ) { 49 super( message ); 50 this.nestedException = nestedException; 51 } 52 53 public void printStackTrace( PrintStream s ) { 54 nestedException.printStackTrace( s ); 55 } 56 57 public void printStackTrace( PrintWriter w ) { 58 nestedException.printStackTrace( w ); 59 } 60 61 public void printStackTrace() { 62 nestedException.printStackTrace(); 63 } 64 65 public Throwable fillInStackTrace() { 66 if ( nestedException == null ) { 67 return super.fillInStackTrace(); 68 } else { 69 return nestedException.fillInStackTrace(); 70 } 71 } 72 73 public Exception getNestedException() { 76 return nestedException; 77 } 78 79 } 80 | Popular Tags |