click-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Malcolm Edgar (JIRA)" <>
Subject [JIRA] Created: (CLK-495) Column decorator error handling improvements
Date Thu, 26 Feb 2009 03:09:56 GMT
Column decorator error handling improvements

                 Key: CLK-495
             Project: Click
          Issue Type: Improvement
          Components: core
    Affects Versions: 1.5
         Environment: Click 1.5
            Reporter: Malcolm Edgar
             Fix For: 2.1.0

I often use decorators for rendering table columns. However if I make a mistake in the Decorator
code (typically a NPE) the source of error is eaten by Velocity, which is generally rendering
the $table in the page.

It would be an improvement if the Column#renderTableDataContent() method caught the error
logged it and re-throw it:

        if (getDecorator() != null) {
        	try {
	            Object value = getDecorator().render(row, context);
	            if (value != null) {
        	} catch (RuntimeException ioe) {
        		throw ioe;

If you make an decorator error you will get a very long, but ultimately useful error message.
For example:

14:02:44,760 INFO  [STDOUT] java.lang.NullPointerException
14:02:44,760 INFO  [STDOUT] 	at java.lang.String.endsWith(
14:02:44,760 INFO  [STDOUT] 	at com.avoka.fc.admin.panel.submission.SubmissionAttachmentPanel$3.render(
14:02:44,760 INFO  [STDOUT] 	at
14:02:44,760 INFO  [STDOUT] 	at
14:02:44,760 INFO  [STDOUT] 	at
14:02:44,760 INFO  [STDOUT] 	at
14:02:44,761 INFO  [STDOUT] 	at
14:02:44,761 INFO  [STDOUT] 	at
14:02:44,761 INFO  [STDOUT] 	at org.apache.velocity.runtime.parser.node.ASTReference.render(
14:02:44,761 INFO  [STDOUT] 	at org.apache.velocity.runtime.parser.node.SimpleNode.render(
14:02:44,761 INFO  [STDOUT] 	at org.apache.velocity.Template.merge(
14:02:44,761 INFO  [STDOUT] 	at

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message