1 5 package xdoclet; 6 7 import java.io.ByteArrayOutputStream ; 8 import java.io.IOException ; 9 import java.io.PrintWriter ; 10 11 import xdoclet.template.TemplateException; 12 13 18 public class XDocletException extends TemplateException 19 { 20 25 public XDocletException(String msg) 26 { 27 this(null, msg); 28 } 29 30 36 public XDocletException(Exception nestedException, String msg) 37 { 38 super(nestedException, msg); 39 } 40 41 46 public String getPrintStackTrace() 47 { 48 try { 49 ByteArrayOutputStream baos = new ByteArrayOutputStream (); 50 PrintWriter writer = new PrintWriter (baos); 51 52 super.printStackTrace(writer); 53 baos.close(); 54 writer.close(); 55 56 return new String (baos.toByteArray()); 57 } 58 catch (IOException e) { 59 e.printStackTrace(); 60 return null; 61 } 62 } 63 } 64 65 | Popular Tags |