Geir,
> > while we are talking about exceptions, you may have noticed
> > that Webmacro
> > has recently introduced an EvaluationExceptionHandler
> > interface, allowing
> > control over how exceptions that occur during template expansion are
> > handled. are there any plans to do something similar in Velocity?
>
> I dunno. We aren't proud. If there is a need, we are happy to honor them
> by blithely stealing their features :)
i feel the need is great :)
> It wouldn't be that hard to do with the EventCartridge mechanism, or
> something similar.
ok, i havn't been folowwing this thread.
> That strikes me as just another event.
>
> But practically speaking, are you really going to want to deal with that
on
> an exception by exception basis? I'm a touch skeptical how much real
> practical use it would get,
essentially we like to do 2 things with exceptions:
1) render "inline", eithier as a comment string, or as somthing informative
for the user.
2) abandon the merge and do something appropiate depending on the exception
an example of practical usage is if you have an object in your context that
has a property with restricted access.
1) you may want to nicely hide the restricted property: "sorry, you are not
allowed to view user's passwords"
2) or you may want to redirect the user to a login page
> especially since you can capture the
> merge()-time exceptions, deal with them, and remerge. That's just my
> personal take...
umm, i had trouble getting merge time exceptions out, i could only get a
MethodInvocationException (hence the initial post). Perhaps i've missed
something.
thanks for your help
timj