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