1 4 package com.tc.aspectwerkz.exception; 5 6 import java.io.PrintStream ; 7 import java.io.PrintWriter ; 8 9 14 public class DefinitionException extends RuntimeException { 15 18 private Throwable originalException; 19 20 25 public DefinitionException(final String message) { 26 super(message); 27 } 28 29 35 public DefinitionException(String message, Throwable throwable) { 36 super(message); 37 this.originalException = throwable; 38 } 39 40 43 public void printStackTrace() { 44 printStackTrace(System.err); 45 } 46 47 52 public void printStackTrace(PrintStream ps) { 53 super.printStackTrace(ps); 54 if (this.originalException != null) { 55 this.originalException.printStackTrace(ps); 56 } 57 } 58 59 64 public void printStackTrace(PrintWriter pw) { 65 super.printStackTrace(pw); 66 if (this.originalException != null) { 67 this.originalException.printStackTrace(pw); 68 } 69 } 70 } | Popular Tags |