Ok, all is in for the addition we talked about for two new exceptions to
be thrown by Runtime.getTemplate() :
 
org.apache.velocity.exception.ResourceNotFoundException
org.apache.velocity.exception.ParseErrorException

They are nothing fancy, but help you distinguish between the two
fundamental errors when dealing with templates ( not finding them and
syntax errors) and deal with them at app level.

So the deal is, wherever you call getTemplate() you can figure out what
is going on :

try
{
  outty =  getTemplate("sample.vm");
}
catch( ParseErrorException pee )
{
}
catch( ResourceNotFoundException rnfe )
{
}
catch( Exception e )
{
  // when things get ugly internally
}

I think I got it all right.  I tested a bit (imagine...).

Will document when the docs get checked in in Anakia form.

geir

-- 
Geir Magnusson Jr.                               [EMAIL PROTECTED]
Developing for the web?  See http://jakarta.apache.org/velocity/

Reply via email to