Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 3559B200C5E for ; Fri, 7 Apr 2017 12:08:48 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 33F1A160B93; Fri, 7 Apr 2017 10:08:48 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7B0C9160B97 for ; Fri, 7 Apr 2017 12:08:47 +0200 (CEST) Received: (qmail 52828 invoked by uid 500); 7 Apr 2017 10:08:46 -0000 Mailing-List: contact notifications-help@freemarker.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@freemarker.incubator.apache.org Delivered-To: mailing list notifications@freemarker.incubator.apache.org Received: (qmail 52712 invoked by uid 99); 7 Apr 2017 10:08:45 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Apr 2017 10:08:45 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 6ECF8C0254 for ; Fri, 7 Apr 2017 10:08:45 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.201 X-Spam-Level: X-Spam-Status: No, score=-99.201 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id gDBEILqNgQln for ; Fri, 7 Apr 2017 10:08:44 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 7915160CD7 for ; Fri, 7 Apr 2017 10:08:43 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 81C72E00B4 for ; Fri, 7 Apr 2017 10:08:42 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id CE02224075 for ; Fri, 7 Apr 2017 10:08:41 +0000 (UTC) Date: Fri, 7 Apr 2017 10:08:41 +0000 (UTC) From: "Vojtech Knyttl (JIRA)" To: notifications@freemarker.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (FREEMARKER-48) When custom fremarker method throws exception, it is impossible to find line/row where called MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 07 Apr 2017 10:08:48 -0000 [ https://issues.apache.org/jira/browse/FREEMARKER-48?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15960576#comment-15960576 ] Vojtech Knyttl commented on FREEMARKER-48: ------------------------------------------ This also happens when division by zero in the form. You have basically no chance of debugging: ``` java.lang.IllegalStateException: Error while freemarker rendering:Ticketing/Reporting/SalesAverage.ftl : / by zero : class java.lang.ArithmeticException org.maite.mvc.FreemarkerService.render(FreemarkerService.java:64) org.maite.mvc.FreemarkerService.render(FreemarkerService.java:48) org.maite.mvc.FreemarkerService$$FastClassBySpringCGLIB$$c133ab89.invoke() org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:629) org.maite.mvc.FreemarkerService$$EnhancerBySpringCGLIB$$37aa939f.render() ``` > When custom fremarker method throws exception, it is impossible to find line/row where called > --------------------------------------------------------------------------------------------- > > Key: FREEMARKER-48 > URL: https://issues.apache.org/jira/browse/FREEMARKER-48 > Project: Apache Freemarker > Issue Type: Bug > Components: engine > Affects Versions: 2.3.25-incubating > Environment: Any > Reporter: Vojtech Knyttl > > Consider this stacktrace: > https://gist.github.com/knyttl/dba8f94b9736eb2751074c34dce7b467 > On line `DispatcherServlet.renderView(DispatcherServlet.java:308)` I have started freemarker to render a template. During that process it uses custom method (`HrefMethod.exec(HrefMethod.java:28)`), but this method threw an exception. However Freemarker does not report a line/row of the template where this method was called making it very hard for debug. > I would be happy if `freemarker.core.MethodCall._eval(MethodCall.java:65)` had some try-catch blcok, that in case of an exception would add lines/rows/details of the element that caused the exception. -- This message was sent by Atlassian JIRA (v6.3.15#6346)