1 52 53 package freemarker.core; 54 55 import java.io.PrintWriter ; 56 import java.io.PrintStream ; 57 58 import freemarker.template.TemplateException; 59 60 64 65 public class StopException extends TemplateException 66 { 67 StopException(Environment env) { 68 super(env); 69 } 70 71 StopException(Environment env, String s) { 72 super(s, env); 73 } 74 75 public void printStackTrace(PrintWriter pw) { 76 String msg = this.getMessage(); 77 pw.print("Encountered stop instruction"); 78 if (msg != null && !msg.equals("")) { 79 pw.println("\nCause given: " + msg); 80 } else pw.println(); 81 super.printStackTrace(pw); 82 } 83 84 public void printStackTrace(PrintStream ps) { 85 String msg = this.getMessage(); 86 ps.print("Encountered stop instruction"); 87 if (msg != null & !msg.equals("")) { 88 ps.println("\nCause given: " + msg); 89 } else ps.println(); 90 super.printStackTrace(ps); 91 } 92 } 93 94 95 | Popular Tags |