You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Byron Foster (JIRA)" <de...@velocity.apache.org> on 2008/10/13 00:44:44 UTC

[jira] Created: (VELOCITY-626) Log to error macro exceptions

Log to error macro exceptions
-----------------------------

                 Key: VELOCITY-626
                 URL: https://issues.apache.org/jira/browse/VELOCITY-626
             Project: Velocity
          Issue Type: Improvement
            Reporter: Byron Foster


This patch logs to error the exceptions that occur within a macro.  This essentially creates a stack trace in the error log of the macro stack levels that contain the exception. For example: (This is with strict reference settings, but the same would be true without strict referencing and an exception was thrown from within the reference call)

#macro(foo1 $f)
  $f
#end
#macro(foo2 $e)
  #foo1($e)
#end
#foo2($x.abc)

Would create a log ouput like so:

ERROR (velocity) Variable $x has not been set at /foo.vm[line 7, column 7]
ERROR (velocity) Exception calling reference $f at /foo.vm[line 2, column 3]
ERROR (velocity) Exception in macro #foo1 at /foo.vm[line 5, column 3]
ERROR (velocity) Exception in macro #foo2 at /foo.vm[line 7, column 1]

Without this it is very difficult to find where an error occurred within nested macros.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Updated: (VELOCITY-626) Log to error macro exceptions

Posted by "Byron Foster (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-626?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Byron Foster updated VELOCITY-626:
----------------------------------

          Component/s: Engine
    Affects Version/s: 1.6

> Log to error macro exceptions
> -----------------------------
>
>                 Key: VELOCITY-626
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-626
>             Project: Velocity
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: 1.6
>            Reporter: Byron Foster
>         Attachments: errorLogStackTrace.patch
>
>
> This patch logs to error the exceptions that occur within a macro.  This essentially creates a stack trace in the error log of the macro stack levels that contain the exception. For example: (This is with strict reference settings, but the same would be true without strict referencing and an exception was thrown from within the reference call)
> #macro(foo1 $f)
>   $f
> #end
> #macro(foo2 $e)
>   #foo1($e)
> #end
> #foo2($x.abc)
> Would create a log ouput like so:
> ERROR (velocity) Variable $x has not been set at /foo.vm[line 7, column 7]
> ERROR (velocity) Exception calling reference $f at /foo.vm[line 2, column 3]
> ERROR (velocity) Exception in macro #foo1 at /foo.vm[line 5, column 3]
> ERROR (velocity) Exception in macro #foo2 at /foo.vm[line 7, column 1]
> Without this it is very difficult to find where an error occurred within nested macros.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Updated: (VELOCITY-626) Log to error macro exceptions

Posted by "Byron Foster (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-626?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Byron Foster updated VELOCITY-626:
----------------------------------

    Attachment: errorLogStackTrace.patch

> Log to error macro exceptions
> -----------------------------
>
>                 Key: VELOCITY-626
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-626
>             Project: Velocity
>          Issue Type: Improvement
>            Reporter: Byron Foster
>         Attachments: errorLogStackTrace.patch
>
>
> This patch logs to error the exceptions that occur within a macro.  This essentially creates a stack trace in the error log of the macro stack levels that contain the exception. For example: (This is with strict reference settings, but the same would be true without strict referencing and an exception was thrown from within the reference call)
> #macro(foo1 $f)
>   $f
> #end
> #macro(foo2 $e)
>   #foo1($e)
> #end
> #foo2($x.abc)
> Would create a log ouput like so:
> ERROR (velocity) Variable $x has not been set at /foo.vm[line 7, column 7]
> ERROR (velocity) Exception calling reference $f at /foo.vm[line 2, column 3]
> ERROR (velocity) Exception in macro #foo1 at /foo.vm[line 5, column 3]
> ERROR (velocity) Exception in macro #foo2 at /foo.vm[line 7, column 1]
> Without this it is very difficult to find where an error occurred within nested macros.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Resolved: (VELOCITY-626) Log to error macro exceptions

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-626?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nathan Bubna resolved VELOCITY-626.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 1.6

> Log to error macro exceptions
> -----------------------------
>
>                 Key: VELOCITY-626
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-626
>             Project: Velocity
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: 1.6
>            Reporter: Byron Foster
>             Fix For: 1.6
>
>         Attachments: errorLogStackTrace.patch
>
>
> This patch logs to error the exceptions that occur within a macro.  This essentially creates a stack trace in the error log of the macro stack levels that contain the exception. For example: (This is with strict reference settings, but the same would be true without strict referencing and an exception was thrown from within the reference call)
> #macro(foo1 $f)
>   $f
> #end
> #macro(foo2 $e)
>   #foo1($e)
> #end
> #foo2($x.abc)
> Would create a log ouput like so:
> ERROR (velocity) Variable $x has not been set at /foo.vm[line 7, column 7]
> ERROR (velocity) Exception calling reference $f at /foo.vm[line 2, column 3]
> ERROR (velocity) Exception in macro #foo1 at /foo.vm[line 5, column 3]
> ERROR (velocity) Exception in macro #foo2 at /foo.vm[line 7, column 1]
> Without this it is very difficult to find where an error occurred within nested macros.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org