/** * Overrides {@link Throwable#printStackTrace(PrintWriter)} so that it will include the FTL stack trace. */ @Override public void printStackTrace(PrintWriter out) { printStackTrace(out, true, true, true); }
/** * Overrides {@link Throwable#printStackTrace(PrintStream)} so that it will include the FTL stack trace. */ @Override public void printStackTrace(PrintStream out) { printStackTrace(out, true, true, true); }
public void handleTemplateException(TemplateException te, Environment env, Writer out) throws TemplateException { if (!env.isInAttemptBlock()) { PrintWriter pw = (out instanceof PrintWriter) ? (PrintWriter) out : new PrintWriter(out); pw.print("FreeMarker template error (DEBUG mode; use RETHROW in production!):\n"); te.printStackTrace(pw, false, true, true); pw.flush(); // To commit the HTTP response } throw te; } };
@Override public void printStackTrace(PrintStream ps) { synchronized (ps) { String msg = this.getMessage(); ps.print("Encountered stop instruction"); if (msg != null && !msg.equals("")) { ps.println("\nCause given: " + msg); } else ps.println(); super.printStackTrace(ps); } }
@Override public void printStackTrace(PrintWriter pw) { synchronized (pw) { String msg = this.getMessage(); pw.print("Encountered stop instruction"); if (msg != null && !msg.equals("")) { pw.println("\nCause given: " + msg); } else pw.println(); super.printStackTrace(pw); } }
/** * @param heading should the heading at the top be printed * @param ftlStackTrace should the FTL stack trace be printed * @param javaStackTrace should the Java stack trace be printed * * @since 2.3.20 */ public void printStackTrace(PrintWriter out, boolean heading, boolean ftlStackTrace, boolean javaStackTrace) { synchronized (out) { printStackTrace(new PrintWriterStackTraceWriter(out), heading, ftlStackTrace, javaStackTrace); } }
/** * @param heading should the heading at the top be printed * @param ftlStackTrace should the FTL stack trace be printed * @param javaStackTrace should the Java stack trace be printed * * @since 2.3.20 */ public void printStackTrace(PrintStream out, boolean heading, boolean ftlStackTrace, boolean javaStackTrace) { synchronized (out) { printStackTrace(new PrintStreamStackTraceWriter(out), heading, ftlStackTrace, javaStackTrace); } }
+ "<b style='font-size:medium'>FreeMarker template error!</b>" + "<pre><xmp>"); te.printStackTrace(pw); pw.println("</xmp></pre></div></html>"); logger.error("Templating error.", te);
te.printStackTrace(stackPW, false, true, true); stackPW.close(); pw.println();
public void handleTemplateException(TemplateException templateException, Environment environment, Writer writer) throws TemplateException { templateException.printStackTrace(System.err); throw templateException; } };
@Override public void handleTemplateException(TemplateException te, Environment env, Writer out) throws TemplateException { te.printStackTrace(); } });
/** * Overrides {@link Throwable#printStackTrace(PrintWriter)} so that it will include the FTL stack trace. */ @Override public void printStackTrace(PrintWriter out) { printStackTrace(out, true, true, true); }
public void handleTemplateException(TemplateException templateException, Environment environment, Writer writer) throws TemplateException { templateException.printStackTrace(System.err); throw templateException; } };
public void printStackTrace(java.io.PrintStream ps) { PrintWriter pw = new PrintWriter(new OutputStreamWriter(ps), true); printStackTrace(pw); pw.flush(); }
public void printStackTrace(PrintWriter pw) { String msg = this.getMessage(); pw.print("Encountered stop instruction"); if (msg != null && !msg.equals("")) { pw.println("\nCause given: " + msg); } else pw.println(); super.printStackTrace(pw); }
@Override public void printStackTrace(PrintWriter pw) { synchronized (pw) { String msg = this.getMessage(); pw.print("Encountered stop instruction"); if (msg != null && !msg.equals("")) { pw.println("\nCause given: " + msg); } else pw.println(); super.printStackTrace(pw); } }
@Override public void printStackTrace(PrintStream ps) { synchronized (ps) { String msg = this.getMessage(); ps.print("Encountered stop instruction"); if (msg != null && !msg.equals("")) { ps.println("\nCause given: " + msg); } else ps.println(); super.printStackTrace(ps); } }
/** * @param heading should the heading at the top be printed * @param ftlStackTrace should the FTL stack trace be printed * @param javaStackTrace should the Java stack trace be printed * * @since 2.3.20 */ public void printStackTrace(PrintWriter out, boolean heading, boolean ftlStackTrace, boolean javaStackTrace) { synchronized (out) { printStackTrace(new PrintWriterStackTraceWriter(out), heading, ftlStackTrace, javaStackTrace); } }
@Override protected void process(TemplateException e) { if (!(e instanceof ModelValidationException)) { Messager messager = getMessager(); StringWriter stackTrace = new StringWriter(); e.printStackTrace(new PrintWriter(stackTrace)); messager.printError(stackTrace.toString()); } this.ee = new EnunciateException(e); }
@Override protected void process(TemplateException e) { if (!(e instanceof ModelValidationException)) { Messager messager = Context.getCurrentEnvironment().getMessager(); StringWriter stackTrace = new StringWriter(); e.printStackTrace(new PrintWriter(stackTrace)); messager.printError(stackTrace.toString()); } this.ee = new EnunciateException(e); }