velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Dekany" <>
Subject Re: No way to catch runtime errors?
Date Sat, 23 Mar 2002 21:06:13 GMT
----- Original Message -----
From: "Geir Magnusson Jr." <>
Sent: Saturday, March 23, 2002 7:43 PM

> On 3/23/02 1:24 PM, "Daniel Dekany" <> wrote:
> > I would like to abort template processing when an error is logged, so
> > template will not run onward in a corrupted state (eg. after null-sets)
> > last not least the designer will see that (s)he did a mistake for sure.
> > Also I would like to log and abort template processing on invalid
> > and invalid directive/macro calls (like #esle).
> > Any idea?
> Well, you can catch the parse exceptions...  We can add an event for null
> set.

I think we should to add error handler events:
- Add event to catch invalid references (since $cutomre will not cause parse
- Add event to catch invalid directive/macro names (since #esle will not
cause parse exception).
- Add event to catch null sets. BTW event for null sets already exists, but
it does not allow me to log and abort the processing, so it is not suitable
for error handling.

 I think an error handling event needs:
- rsvc
- the context (if applicable)
- other error specific information
- A way to singal if the processing should aborted. Perhaps a string as
return value which is an error message if we want to abort processing or
null if we don't want to. Another approach is to log an error and then let
LogSystem decide if it wants to abort the processing or not. But AFAIK this
is not possible now, see below.

> An easy way would be to make a logger and look for errors being sent to
> it...

Yes, but log LogSystem.logVelocityMessage does not allows me to abort
template processing. (Or just I'm lame. How could I do that?)

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message