1 2 17 18 package org.apache.poi.hpsf; 19 20 import java.io.PrintStream ; 21 import java.io.PrintWriter ; 22 23 33 public class HPSFRuntimeException extends RuntimeException 34 { 35 36 38 private Throwable reason; 39 40 41 42 45 public HPSFRuntimeException() 46 { 47 super(); 48 } 49 50 51 52 58 public HPSFRuntimeException(final String msg) 59 { 60 super(msg); 61 } 62 63 64 65 72 public HPSFRuntimeException(final Throwable reason) 73 { 74 super(); 75 this.reason = reason; 76 } 77 78 79 80 88 public HPSFRuntimeException(final String msg, final Throwable reason) 89 { 90 super(msg); 91 this.reason = reason; 92 } 93 94 95 96 103 public Throwable getReason() 104 { 105 return reason; 106 } 107 108 109 110 113 public void printStackTrace() 114 { 115 printStackTrace(System.err); 116 } 117 118 119 120 123 public void printStackTrace(final PrintStream p) 124 { 125 final Throwable reason = getReason(); 126 super.printStackTrace(p); 127 if (reason != null) 128 { 129 p.println("Caused by:"); 130 reason.printStackTrace(p); 131 } 132 } 133 134 135 136 139 public void printStackTrace(final PrintWriter p) 140 { 141 final Throwable reason = getReason(); 142 super.printStackTrace(p); 143 if (reason != null) 144 { 145 p.println("Caused by:"); 146 reason.printStackTrace(p); 147 } 148 } 149 150 } 151 | Popular Tags |