velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <ge...@optonline.net>
Subject Re: Velocity and wrong file name
Date Tue, 20 Feb 2001 15:24:42 GMT
What would be the most useful here?

We are free to throw an exception here as the definition of merge()
allows that.  We don't know, at the moment, what the reason is in
merge(), because either

1) the template wasn't available (invalid filename)

2) the template did exist, but there was a parse error. 

In either case, it will be clear from the log what happened. 

We can figure it out within Template by being a little more careful in
process() when we get the resource from the loader, and then when we
parse, so we *can* figure it out.

Would it help to have something more structured than simply an Exception
with a nice message, or is having a set of exceptions going to help? 
There is not much you can practically do, btw, from your app if your
template doesn't parse...

geir



Hervé Guidetti wrote:
> 
> > Hervé Guidetti wrote:
> > >
> > > Hi,
> > >
> > > I use Velocity  via the TurbineVelocity service.
> > > I call :
> > > handleRequest(context, filename, bytes);
> > >
> > > But if the filename is wrong (the file doesn't exist) the bytes array
> > > (bytes) is empty and no exception is thrown.
> > > Is that normal ?
> > > I'd except an exception ?
> > > It seems logical to get an exception. Isn't it ??
> > > Is that a bug ?
> > >
> > > Thanks.
> > >
> > > Hervé Guidetti
> >
> >
> > For specific Turbine questions, your best bet would be the Turbine
> > lists.  Thanks very much.
> >
> > geir
> >
> 
> I did. But this is not a Turbine problem. Turbine just calls Velocity with
> this code :
> handleRequest(context, filename, bytes);
> But if the filename isn't valid, no exception is thrown.
> 
> Hervé

-- 
Geir Magnusson Jr.                               geirm@optonline.com

Developing for the web?  See http://jakarta.apache.org/velocity

Mime
View raw message