1 23 24 package org.enhydra.error; 25 26 import java.io.PrintStream ; 27 import java.io.PrintWriter ; 28 29 34 public class ChainedError extends Error implements ChainedThrowable { 35 36 private Throwable fCause; 37 38 43 protected ChainedError(String msg) { 44 super(msg); 45 fCause = null; 46 } 47 48 54 protected ChainedError(String msg, 55 Throwable cause) { 56 super(msg); 57 fCause = cause; 58 } 59 60 66 protected ChainedError(Throwable cause) { 67 super(ChainedThrowableSupport.makeMessage(cause)); 68 fCause = cause; 69 } 70 71 75 public String getMessage() { 76 return ChainedThrowableSupport.getMessage(this, super.getMessage()); 77 } 78 79 82 public String getLocalizedMessage() { 83 return ChainedThrowableSupport.getLocalizedMessage(this, super.getLocalizedMessage()); 84 } 85 86 90 public Throwable getCause() { 91 return fCause; 92 } 93 94 98 public void printStackTrace() { 99 super.printStackTrace(); 100 ChainedThrowableSupport.printCauseTrace(this); 101 } 102 103 107 public void printStackTrace(PrintStream s) { 108 super.printStackTrace(s); 109 ChainedThrowableSupport.printCauseTrace(this, s); 110 } 111 112 116 public void printStackTrace(PrintWriter s) { 117 super.printStackTrace(s); 118 ChainedThrowableSupport.printCauseTrace(this, s); 119 } 120 121 } 122 | Popular Tags |