1 43 package net.jforum.exceptions; 44 45 import java.io.PrintWriter ; 46 import java.io.StringWriter ; 47 48 52 public class ForumException extends RuntimeException  53 { 54 public ForumException(String message) 55 { 56 super(message); 57 } 58 59 public ForumException(String message, Throwable t) 60 { 61 this(message + " - " + buildStackTrace(t)); 62 } 63 64 protected static String buildStackTrace(Throwable t) 65 { 66 StringWriter strWriter = new StringWriter (); 67 PrintWriter writer = new PrintWriter (strWriter); 68 t.printStackTrace(writer); 69 writer.close(); 70 71 return strWriter.toString(); 72 } 73 } 74 | Popular Tags |