1 8 package org.codehaus.aspectwerkz.exception; 9 10 import java.io.PrintStream ; 11 import java.io.PrintWriter ; 12 13 19 public class DefinitionException extends RuntimeException { 20 23 private Throwable originalException; 24 25 30 public DefinitionException(final String message) { 31 super(message); 32 } 33 34 40 public DefinitionException(String message, Throwable throwable) { 41 super(message); 42 this.originalException = throwable; 43 } 44 45 48 public void printStackTrace() { 49 printStackTrace(System.err); 50 } 51 52 57 public void printStackTrace(PrintStream ps) { 58 super.printStackTrace(ps); 59 if (this.originalException != null) { 60 this.originalException.printStackTrace(ps); 61 } 62 } 63 64 69 public void printStackTrace(PrintWriter pw) { 70 super.printStackTrace(pw); 71 if (this.originalException != null) { 72 this.originalException.printStackTrace(pw); 73 } 74 } 75 } | Popular Tags |