velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Lloyd-Newberry <new...@yahoo.com>
Subject EventCartridge
Date Mon, 16 Jul 2001 20:41:35 GMT
Hey All,

    Frequently in processor that I am writing/using I need to be able
to give users (i.e. me) a "intelligent" message in regards to what is
happening when there are null references or other velocity odditities
in their templates.

    Right now I can use an EventCartridge to catch a NullSetEvent or a
MethodExceptionEvent, but I am at a loss as to how to make use of the
event to display a line and resource identifier so the user can fix
their problem. As I see the code it is not possible to get information
relative to the node that an event came from (where I could get the
line and column) and even if i had a node get the resource it was
parsed from.

    The "look in the velocity log" argument is not really an option for
writing a viable tool as far as I see it for several reasons. Is this
something that would be desirable to others? Is this the intention of
the EventCartridge? It seems like an Event in the Cartridge should
contain the source node for the event. I would be willing to look at
the code and "work on it" unless I get screamed down. :)

    Another issue is that sometimes I get messed up line numbers or
line numbers without reference to a resource in the log when something
funky happens. Usually I am merging multiple resources one after
another in the same Velocity instance with the same Context. Is this a
known issue? I can probably come up with test cases to show it
happening if need be.

-Brian


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

Mime
View raw message