This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository wao. See http://git.codelutin.com/wao.git commit bea67c664db95ab4b3fc86163bcbb5f30a27f1aa Author: Brendan Le Ny <bleny@codelutin.com> Date: Tue Oct 28 17:54:42 2014 +0100 On journalise les erreurs dans JFreeChartToImgTagConverter car les exceptions lancées sont perdues par Struts --- .../wao/web/converter/JFreeChartToImgTagConverter.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/wao-web/src/main/java/fr/ifremer/wao/web/converter/JFreeChartToImgTagConverter.java b/wao-web/src/main/java/fr/ifremer/wao/web/converter/JFreeChartToImgTagConverter.java index 5ec6152..9fe7f81 100644 --- a/wao-web/src/main/java/fr/ifremer/wao/web/converter/JFreeChartToImgTagConverter.java +++ b/wao-web/src/main/java/fr/ifremer/wao/web/converter/JFreeChartToImgTagConverter.java @@ -23,6 +23,8 @@ package fr.ifremer.wao.web.converter; import com.google.common.io.BaseEncoding; import fr.ifremer.wao.WaoTechnicalException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.struts2.util.StrutsTypeConverter; import org.jfree.chart.ChartUtilities; import org.jfree.chart.JFreeChart; @@ -33,6 +35,8 @@ import java.util.Map; public class JFreeChartToImgTagConverter extends StrutsTypeConverter { + private static final Log log = LogFactory.getLog(JFreeChartToImgTagConverter.class); + @Override public Object convertFromString(Map context, String[] values, Class toClass) { throw new UnsupportedOperationException(); @@ -41,6 +45,8 @@ public class JFreeChartToImgTagConverter extends StrutsTypeConverter { @Override public String convertToString(Map context, Object o) { + // XXX brendan 28/10/14 inutile de lancer une exception... C'est perdu par struts + if (o instanceof JFreeChart) { JFreeChart chart = (JFreeChart) o; @@ -50,6 +56,9 @@ public class JFreeChartToImgTagConverter extends StrutsTypeConverter { try { ChartUtilities.writeChartAsPNG(output, chart, 1000, 600); } catch (IOException e) { + if (log.isErrorEnabled()) { + log.error("unable to write chart to PNG", e); + } throw new WaoTechnicalException("unable to write chart to PNG", e); } @@ -62,8 +71,12 @@ public class JFreeChartToImgTagConverter extends StrutsTypeConverter { return html; } else { - throw new WaoTechnicalException("unable to convert " + o); + if (log.isErrorEnabled()) { + log.error("unable to convert " + o); + } + throw new UnsupportedOperationException("unable to convert " + o); } + } } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.