1 4 package com.tc.aspectwerkz.exception; 5 6 import java.io.PrintStream ; 7 import java.io.PrintWriter ; 8 9 14 public class WrappedRuntimeException extends RuntimeException { 15 18 private final Throwable m_throwable; 19 20 23 private final String m_message; 24 25 30 public WrappedRuntimeException(final Throwable throwable) { 31 m_throwable = throwable; 32 m_message = throwable.getMessage(); 33 } 34 35 41 public WrappedRuntimeException(final String message, final Throwable throwable) { 42 m_throwable = throwable; 43 m_message = message; 44 } 45 46 51 public String getMessage() { 52 return m_message; 53 } 54 55 60 public String getLocalizedMessage() { 61 return m_throwable.getLocalizedMessage(); 62 } 63 64 69 public Throwable getCause() { 70 return m_throwable; 71 } 72 73 78 public String toString() { 79 return (m_message==null ? "" : m_message) + "; " + m_throwable.toString(); 80 } 81 82 84 87 public void printStackTrace() { 88 m_throwable.printStackTrace(); 89 } 90 91 96 public void printStackTrace(final PrintStream s) { 97 m_throwable.printStackTrace(s); 98 } 99 100 105 public void printStackTrace(final PrintWriter s) { 106 m_throwable.printStackTrace(s); 107 } 108 109 } | Popular Tags |