1 8 package org.codehaus.aspectwerkz.exception; 9 10 import java.io.PrintStream ; 11 import java.io.PrintWriter ; 12 13 18 public class WrappedRuntimeException extends RuntimeException { 19 22 private final Throwable m_throwable; 23 24 27 private final String m_message; 28 29 34 public WrappedRuntimeException(final Throwable throwable) { 35 m_throwable = throwable; 36 m_message = throwable.getMessage(); 37 } 38 39 45 public WrappedRuntimeException(final String message, final Throwable throwable) { 46 m_throwable = throwable; 47 m_message = message; 48 } 49 50 55 public String getMessage() { 56 return m_message; 57 } 58 59 64 public String getLocalizedMessage() { 65 return m_throwable.getLocalizedMessage(); 66 } 67 68 73 public Throwable getCause() { 74 return m_throwable; 75 } 76 77 82 public String toString() { 83 return m_throwable.toString(); 84 } 85 86 88 91 public void printStackTrace() { 92 m_throwable.printStackTrace(); 93 } 94 95 100 public void printStackTrace(final PrintStream s) { 101 m_throwable.printStackTrace(s); 102 } 103 104 109 public void printStackTrace(final PrintWriter s) { 110 m_throwable.printStackTrace(s); 111 } 112 113 } | Popular Tags |