1 22 23 package org.webdocwf.util.loader; 24 25 import java.io.ByteArrayOutputStream ; 26 import java.io.PrintStream ; 27 import java.io.PrintWriter ; 28 29 36 public class LoaderException extends Exception { 37 38 private Throwable cause; 39 40 44 public LoaderException(String msg) { 45 super(msg); 46 cause = null; 47 } 48 49 54 public LoaderException(String msg, 55 Throwable cause) { 56 super(msg); 57 this.cause = cause; 58 } 59 60 64 public String getMessage() { 65 return super.getMessage(); 66 } 67 68 72 public Throwable getCause() { 73 return cause; 74 } 75 76 80 public void printStackTrace() { 81 super.printStackTrace(); 82 Throwable a = new Throwable (); 83 a.printStackTrace(); 84 } 85 86 91 public void printStackTrace(PrintStream s) { 92 super.printStackTrace(s); 93 Throwable a = new Throwable (); 94 a.printStackTrace(s); 95 } 96 97 102 public void printStackTrace(PrintWriter s) { 103 super.printStackTrace(s); 104 Throwable a = new Throwable (); 105 a.printStackTrace(s); 106 } 107 108 112 public String getStackTraceAsString() { 113 ByteArrayOutputStream out = new ByteArrayOutputStream (); 114 this.printStackTrace(new PrintStream (out)); 115 return out.toString(); 116 } 117 } 118 | Popular Tags |