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; } };
public void handleTemplateException(TemplateException te, Environment env, Writer out) throws TemplateException { if (!env.isInAttemptBlock()) { boolean externalPw = out instanceof PrintWriter; PrintWriter pw = externalPw ? (PrintWriter) out : new PrintWriter(out);
&& !isInAttemptBlock() /* because then the AttemptExceptionReporter will report this */) { LOG.error("Error executing FreeMarker template", templateException); } catch (TemplateException e) { if (isInAttemptBlock()) { this.getAttemptExceptionReporter().report(templateException, this);
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; } };
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; } };
public void handleTemplateException(TemplateException te, Environment env, Writer out) throws TemplateException { if (!env.isInAttemptBlock()) { boolean externalPw = out instanceof PrintWriter; PrintWriter pw = externalPw ? (PrintWriter) out : new PrintWriter(out);
public void handleTemplateException(TemplateException te, Environment env, Writer out) throws TemplateException { if (!env.isInAttemptBlock()) { boolean externalPw = out instanceof PrintWriter; PrintWriter pw = externalPw ? (PrintWriter) out : new PrintWriter(out);
&& !isInAttemptBlock() /* because then the AttemptExceptionReporter will report this */) { LOG.error("Error executing FreeMarker template", templateException); } catch (TemplateException e) { if (isInAttemptBlock()) { this.getAttemptExceptionReporter().report(templateException, this);
&& !isInAttemptBlock() /* because then the AttemptExceptionReporter will report this */) { LOG.error("Error executing FreeMarker template", templateException); } catch (TemplateException e) { if (isInAttemptBlock()) { this.getAttemptExceptionReporter().report(templateException, this);