1 23 24 package org.enhydra.error; 25 26 import java.io.PrintStream ; 27 import java.io.PrintWriter ; 28 29 34 public class ChainedException extends Exception implements ChainedThrowable { 35 36 private Throwable fCause; 37 38 43 public ChainedException(String msg) { 44 super(msg); 45 fCause = null; 46 } 47 48 55 public ChainedException(String msg, 56 Throwable cause) { 57 super(msg); 58 fCause = cause; 59 } 60 61 68 public ChainedException(Throwable cause) { 69 super(ChainedThrowableSupport.makeMessage(cause)); 70 fCause = cause; 71 } 72 73 77 public String getMessage() { 78 return ChainedThrowableSupport.getMessage(this, super.getMessage()); 79 } 80 81 84 public String getLocalizedMessage() { 85 return ChainedThrowableSupport.getLocalizedMessage(this, super.getLocalizedMessage()); 86 } 87 88 92 public Throwable getCause() { 93 return fCause; 94 } 95 96 100 public void printStackTrace() { 101 super.printStackTrace(); 102 ChainedThrowableSupport.printCauseTrace(this); 103 } 104 105 109 public void printStackTrace(PrintStream s) { 110 super.printStackTrace(s); 111 ChainedThrowableSupport.printCauseTrace(this, s); 112 } 113 114 118 public void printStackTrace(PrintWriter s) { 119 super.printStackTrace(s); 120 ChainedThrowableSupport.printCauseTrace(this, s); 121 } 122 } 123 | Popular Tags |